Questions tagged [htaccess]

The hypertext access web server configuration file used for overriding configuration on a per-directory basis.

Filter by
Sorted by
Tagged with
0
votes
0answers
4 views

Keep updates with a vbscript on hta: list folders from a remote computer

I'm writing a little hta to keep some updates and their records and I'm desperate to find a way to list subfolders on a remote folder and output in html with a button to "rollback" (copy the ...
0
votes
1answer
13 views

Apache2 Logs - Single user agent shows as an escaped string

first time caller long time listener. I've been playing around with hosting my own web server via Apache on an Ubuntu VM. I've been reviewing the access.log file, and noticed a discrepancy I can't ...
1
vote
1answer
7 views

.htaccess RewriteRule works but Redirect 301 does not

I have launched a new version of a website on a new domain. On the old domain I have redirected traffic to the new domain with a global RewriteRule. RewriteRule (.*)$ https://www.newsite.com/$1 [R=...
0
votes
0answers
9 views

redirect only subdomain to domain, but not files, also deny php file access (.htaccess)

RewriteEngine On RewriteCond %{HTTP_HOST} ^cdn\.swat\.host$ [NC] RewriteRule ^ https://swat.host [L,R] I tried this ^ But it will redirect anything after / too. Also I would like to deny php ...
0
votes
0answers
28 views

.htaccess File is being Ignored

I have been following this tutorial for setting up my htaccess file. Mainly for SSL reasons and error document reasons First issue is this apache2 location: sudo nano /etc/apache2/sites-available/...
0
votes
0answers
51 views

How to htaccess rewrite such that subdomain.domain.com accesses a subdirectory?

I do this all the time with Wordpress and it's easy, but I'm having trouble applying the same approach to an installation of OSTicket (support desk script). I've installed the script in subdomain....
0
votes
0answers
19 views

How to create an exception, or exclude certain files from a php-file-extension Snippet in .htaccess? This example failed

This is a .php file extension removal snippet, for displaying links online. RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC] RewriteRule ^ %1 [R,L] This is where i make an exception to ...
0
votes
1answer
83 views

Redirect to a specified port when using https

I have an internal domain: cloud.flint.lo I would like to achieve the following: If URL=http://cloud.filnt.lo Redirect to: https://cloud.flint.lo:5001/sub If URL=https://cloud.flint.lo ...
1
vote
0answers
11 views

I'm running Apache 2.4.7, but my .htaccess files are only working with pre-2.4 directives & syntax

I've been dealing with a pretty unusual issue all day. My remote server is running Apache version is 2.4.7 However, when I start setting up directives in the .htaccess files such as this: <...
0
votes
0answers
75 views

Google 404 Page appears on my domain after using Google Search Console

I have an Apache server with htaccess settings that redirects all traffic from www.example.com towards example.com. Then, I started using Google Search Console. However, after setting up the TXT DNS, ...
1
vote
0answers
36 views

phpmyadmin not working after php verion Update

I have VPS with below things installed Nginx, PHP 7.2.22, 10.3.18-MariaDB Recently Updated PHP version from 7.1.17 to 7.2.22 .. After this, website is working fine.. PHPMyAdmin set on custom ...
0
votes
1answer
558 views

Google Cloud-How to access and edit .htaccess on Wordpress Bitnami on google-cloud-platform

If anyone can please guide me on How to edit .htaccess file in WP-Bitnami installation on Google cloud platform.
1
vote
2answers
369 views

Apache 2.4 .htaccess Require statements ignored

I'm trying to restrict per-client subdirectories of an application containing static reports using .htaccess files programatically generated with a list of users for each customer, but while I can ...
0
votes
0answers
32 views

redirect a link to a subdomain in htaccess with regex

I Want To Redirect a Link To a Subdomain Link Like As Bellow: sample.com/seminar/details/3 to old.sample.com/seminar/details/3 What Should I Type In Htaccess File In Cpanel For Redirection? I ...
0
votes
0answers
29 views

Helicon APE on Microsoft Azure

We currently have a production site running on a Windows Server 2012 R2 Virtual Machine and are using Helicon APE IIS Module to handle all of our site authentication and URL rewrites/redirects. We ...
0
votes
0answers
20 views

Apache redirect treating a file like a directory

I have three files, an index that's a wrapper for the other two, file1 and file2. It uses a PHP server variable to determine which to include. By default, the wrapper includes file1. So, /, /index ...
0
votes
1answer
100 views

htaccess to Nginx rewrite rules

I've converted apache htaccess rules to nginx rewrite rules but they are not working for me. Apache .htaccess rules RewriteEngine On RewriteBase /public/layout/themes/ RewriteCond %{...
0
votes
1answer
63 views

htaccess if directive does not work

The following directive appears to fail in that it results in a 403 error. The server supports version 2.4 of Apache. <If "%{REQUEST_URI} =~ m#^(.*)?/uploads/(.*\.txt)#"> Require all denied ...
0
votes
0answers
16 views

How to measure the efficacy and security of htaccess directives?

The following logical groups of directives are intended to deliver the same outcome i.e. restricting access to directories and/or files. It seems to be that the second logical group is more efficient ...
2
votes
0answers
24 views

Query about htaccess

I have developed a website which has a structure that can be summarised as: htdocs .htaccess ... wp-content ... uploads ... Private .htaccess ...
0
votes
0answers
99 views

.htaccess not working on some files

My .htaccess file looks like: # Prevent .htaccess files from being viewed <Files ".ht*"> Require all denied </Files> # Deny access to files with extensions <Files ".*\.md"> ...
0
votes
1answer
123 views

Nginx rewrite rules not working

We are moving our site from Apache to Nginx. So far, the rules that we have converted from .htaccess rules to nginx are working fine but this particular rule is giving me a hard time. I've tried ...
0
votes
0answers
19 views

Absolute Path redirection using .htaccess when shifting from one shared Linux cpanel web hostin to another

I have shifted my hosting from one hosting to another. I am attempting to redirect the absolute path of old server with the absolute of new one. There are many includes in the script, which calls ...
0
votes
0answers
107 views

500 internal error in laravel application in aws ec2 server with apache

I am trying to deploy a Laravel app on AWS instance. Both server & MySQL are in the same db. DB shows connected. When I hit aws public ip/controllername it gives internal error. In local ...
0
votes
1answer
105 views

Redirect rule for URLs ending with the same suffix?

So I have a number of pages with URLs end in the same thing but have different content between the main URL and the final suffix. Some of these have multiple levels. For example: https://www.example....
0
votes
1answer
67 views

How do I use .htaccess with offline html?

I have an offline webpage composed of Html, CSS, and JS, it runs completely offline. One problem, I want to use htaccess to add Username/Passwords to my webpage, along with other features of htaccess, ...
0
votes
0answers
31 views

Automatic site builder failing to create .htaccess files locally

I have a vagrant box with PHP code building a site in it. The user is vagrant with id: uid=900(vagrant) gid=900(vagrant) groups=900(vagrant),27(sudo),1002(admin) The parent directory in question ...
1
vote
0answers
105 views

Nextcloud service discovery not fully working

I have a nextcloud instance on shared hosting. Unfortunately I cannot use it for cal-/carddav because (only) macs cannot seem to find the offered services. Since a few versions, the nextcloud ...
0
votes
1answer
23 views

Static html site, additional parameters after page still work. How to display 404?

I have a site that is 100% static html. I noticed that Google was showing that I have several pages that show additional parameters at the end of the URL. Example: https://www.example.com/page1....
0
votes
2answers
220 views

Why Is .html File In Root Directory Not Rendering In Browser? Shows Index Of/

Hello I just have a simple .html file in the root directory of my site: But when I visit that site in the browser, it's showing me index of/ and I have to click on test.html in order to display the ...
0
votes
0answers
73 views

.htaccess redirect site X to site Y without loosing URI

I tried to figure out how to redirect 401.shtml to index.php. It works like this: Redirect /401.shtml /index.php But if there is a URI then it should redirect to the URI instead of index.php. e.g....
1
vote
1answer
44 views

Can't figure out a htaccess rule

I have this in my htaccess but can't figure out what its for. Because of the nature of rule, searching doesn't help either. RewriteCond %{REQUEST_URI} !(/$|\.) RewriteRule (.*) %{REQUEST_URI}/ [R=301]...
1
vote
1answer
60 views

Redirecting another domain to a current domain assigned to a Wordpress website

I have two domains example.com and example.org which are both registered through 1&1. The current Wordpress website uses the .org and the .com domain has been set to be redirected to .org from the ...
0
votes
1answer
68 views

Redirect Non WWW to WWW - htaccess placed in sub-folder

I am working on a site which has .htaccess file in root. There is a folder named babynames. This folder also has .htaccess file. I need the code to redirect from NON WWW to WWW for this folder. ...
0
votes
1answer
1k views

Apache 2.4 'require host not' works but gives repeated AH01753 [authz_host:error] in apache error log

Something is bothering me after my hosting provider went from Apache 2.2 to Apache 2.4. I had these Apache 2.2 rules in my .htaccess order allow,deny deny from domain.tld deny from 1.2.3.4 ...
0
votes
1answer
207 views

How to use Webstorm's local server with a .htaccess file to show pages without .html

I have configured the .htaccess file as per this StackOverflow article. I am now wondering how I get the same functionality for Webstorm as I have setup my links such that they don't have '.html' at ...
0
votes
1answer
47 views

Use sub-domain of domain in another server

I have two hosting services. One is already in use and has domain example.com. It also has a sub-domain called order.example.com. Second hosting service is under Amazon (EC2). How can I use order....
1
vote
1answer
45 views

SSL forwarding for just one subdomain in .htaccess

I have Apache(ubuntu) server and I need to force https just for sub1.domain.com. Currently all traffic are being forwarded RewriteEngine On RewriteCond %{HTTPS} ...
0
votes
0answers
116 views

What htaccess rules will REMOVE the subdirectory serving the site from the URI (404 if included) & internal links?

**SEE UPDATE BELOW***** My primary domain site is to be served from a subdirectory on my server that is named same as the domain, so that will probably be confusing to read in this messy block of my ...
1
vote
0answers
243 views

redirect subdirectory requests to alternate server:port

I'm using the following .htaccess to redirect requests to domain root ( http://example.com ) in apache to an alternate webserver on the same host listening on an alternate port ( http://example.com:...
2
votes
2answers
3k views

How to use .htaccess to block Russian IP addresses?

I added this code to my .htaccess file #deny all russian IP's Order allow,deny deny from .ru Allow from all My questions: Can it go anywhere in the file? I added it to the end. Do I put the code in ...
0
votes
1answer
388 views

Removing lingering end string after RewriteRule

I've tried everything but just can't seem to get things right :( I have over 800 urls and I need to rewrite them to point to a simple pdf file. Currently, I have links to: http://subdomain.mydomain....
0
votes
1answer
30 views

Redirect links using .htaccess file

I have a site with a lot of links that look like /click.php_id=602_from=139_to=42_url=1.html. I'd like to setup a redirect using .htaccess file(s) to have links that look like /click.php?id=602&...
1
vote
1answer
56 views

How to point URL to directory? [closed]

I need to point web url's like http://example.com/subdir1 http://example.com/subdir2 to same directory /var/www/vhosts/example.com/httpdocs/default/ on Linux hosting (Ubuntu 16.04, Apache2) - how ...
1
vote
1answer
34 views

Allow http access only from two selected IPs and get alerts for other attempted logins

we want a system where our server can be accessed only by 2 selected systems. Also we need to log any other attempted access. One possible option we have is: order deny,allow deny from all allow ...
2
votes
0answers
924 views

Redirect multiple domains and subdomain with .htaccess

I am struggling with setting proper https redirect via a .htaccess file for my domains. I have the following domains, subdomains and directories: public_html/ -> www.red.com public_html/drk -&...
0
votes
1answer
139 views

Browser displays Apache Test page when accessing website with a domain name I have just registered

My website is deployed on Tomcat which in turn in deployed on Ubuntu server. While developing the website I access it using server IP address like xxx.xxx.xxx.xxx:8080:/yyyy. Now I have bought a ...
0
votes
0answers
227 views

Possible .HTACCESS Issue

I am running a youtube clone script on a local install of XAMPP via a windows 7 machine. After installation I am able to see the home page but if I navigate to any other page either by link or direct ...
1
vote
2answers
7k views

Forcing HTTPS with .htaccess on site with Wordpress in subfolder

I can't get my .htaccess file to work to force HTTPS traffic Site structure that I see if I ftp to my hosting provider: / domains mydomainname.com public_html blog The files for ...
0
votes
1answer
4k views

Howto change the port in an URL using .htaccess

Using .htaccess, I need to change any URL of this kind https://example.com:80/webtrees/anything_else by exactly the same, but with 443 instead of 80 Note that I already have this in my .htaccess (it ...