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
17 views

Renaming a download file via htaccess

I currently have in a server files in this format https://example.com/files/{group_no}/{date}/{file_no}-file.txt Being: group_no an integer (NN) date format YYYY-MM-DD file_no an integer (NN) ...
0
votes
0answers
23 views

Remove parameters from URL

I need remove a parameter from urls with htaccess from 1) http://example.com/?id=126:&catid=89 2) http://example.com/page?id=126:&catid=89 to 1) http://example.com/ 2) http://example.com/page ...
0
votes
0answers
27 views

.htaccess to map to subdirectory AND force HTTPS

I have an Apache 2.4 server set up on a Synology Disk Station. The DocumentRoot of the web server, to which my domain name is mapped, seems to unavoidably be /web as I do not have access to the Apache ...
0
votes
0answers
34 views

301 Redirects with multiple folder exceptions?

I have tried so many ways to redirect some pages directly, ignore a few folders and redirect anything remaining to a new domain homepage. What works The specific 301 redirects work fine and the ...
0
votes
0answers
16 views

Apache - Set cookie for redirection

I have a multilingual site. The default route is in english http://myproject.local/. I want to redirect users to their browser language by default but when they switch to an other language, I want to ...
0
votes
0answers
19 views

Why isn't my trafic redirected to the subdirectory?

I have made a little .htaccess "script" that (should) redirect all of my trafic to the domain to a subfolder named "react" that contains, well, my React app. Here is my .htaccess: ...
0
votes
1answer
19 views

Setting default webpage for shared hosting [closed]

I've got a bunch of domains on a shared ip address (through bluehost, not sure if that matters). Visiting any domain works fine, but visiting the ip address just triggers a 404 error. After doing some ...
0
votes
0answers
12 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
24 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
13 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
1answer
108 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: <...
1
vote
0answers
68 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
2k 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
519 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
1answer
115 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 %{...
1
vote
1answer
216 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 ...
1
vote
0answers
28 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
122 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 ".*\....
0
votes
1answer
367 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
1answer
180 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
135 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
135 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
30 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
406 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
93 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
45 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
65 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
108 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. ...
1
vote
1answer
2k 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
282 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
46 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
119 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
275 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
454 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
32 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
116 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 ...
3
votes
0answers
982 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
177 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
231 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
8k 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
5k 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 ...
0
votes
0answers
114 views

How to redirect url in htaccess with regex?

My url is changing and for example now it is ..safety-bathroom then is changing to safety-bathroom-1 and so on, to avoid daily changing rule in htaccess I would like to have a rule which will do ...
0
votes
1answer
11 views

utilize htaccess to rewrite all indexes

upon a 404 I want to set my htaccess file to utilize another file from another location in lieu of the missing file. The url must remain the same as if the file was in the directory & more ...
5
votes
2answers
3k views

Redirect all HTTP traffic to HTTPS including subdomains

I'm trying to redirect all HTTP traffic to HTTPS including subdomains. I have the domain setup with FastComet on their Shared Hosting using cPanel. Some examples of how I like to redirect. http://www....
0
votes
1answer
464 views

Redirecting visitor with htaccess to another URL based on IP range

I've pored through other questions to find a solution, and the closest I've come is Zerobinary99's question here: How do regular expressions work in htaccess to redirect an IP range However, I'm not ...