Questions tagged [.htaccess]
Directory-level configuration file found mostly on Apache web servers
2,853 questions
0
votes
0
answers
51
views
How to base apache htaccess on folder/file whitelist instead of a blacklist?
I am trying to set up an access policy in the .htaccess file, note that I am aware of other protection layers like server config in VirtualHosts, file permissions etc. - this question is not about ...
0
votes
1
answer
129
views
htaccess: Wordpress does not redirect the exact url
I am new to wordpress and cPanel.
I created a wordpress site inside a sub folder of public_html folder.
Here the structure:
root
|- public_html
|- mcg-main
But I want that mag-main does not ...
1
vote
1
answer
511
views
.htaccess file rewrite rules processed although main config file ends rewrite
I have to allow CORS on an apache server. For this, I have set the according Access-Control-Allow-Origin etc. headers in the http main config file, so far so good.
For the CORS request to work as ...
3
votes
1
answer
79
views
LiteSpeed server returns HTTP 500 on PrestaShop subdirectory root (/shop/), but 200 OK on deeper paths (/shop/es/)
I am debugging a persistent and very specific HTTP 500 error on a LiteSpeed server running PrestaShop 1.7.8.9.
Environment:
Web Server: LiteSpeed
PHP: 7.4 (running as PHP-FPM)
Application: ...
8
votes
3
answers
1k
views
Why RewriteRule behaves different if request URL has a trailing slash and when not?
My intention is to serve a website from a subfolder without changing the document root to point at that folder (since I cannot because it is on a shared hosting).
For this purpose I added this to my ....
0
votes
0
answers
105
views
.htaccess to nginx.conf doesn't work
I'm using NGINX to run a wordpress membership site, where I need to restrict access to specific files and memberships, but in order for this to work I must add the following rules to .htaccess:
...
0
votes
1
answer
67
views
Apache: variable export from .htaccess
I have a .htaccess which looks like this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=FOO:bar]
</IfModule>
This is slightly simplified, but the original contains no ...
0
votes
1
answer
148
views
htaccess - How to leave only 1st URL parameter and remove the rest parameters if there are any
Google is crawling somewhere my URLs with some non-existing garbage URL parameters at the end of canonical URLs.
So, how to leave only 1st URL parameter and remove the rest parameters if there are any ...
0
votes
0
answers
59
views
How to externalize a list of ip addresses to allow requests to apache resource
I have some .htaccess files to limit some resources just from some ip.
I would like to keep the ip list in a separate file and avoid to change all .htaccess files when I need to add some ip.
Is it ...
1
vote
1
answer
230
views
htaccess: URL rewrite/forwarding with parameters
I want to forward URLs (with parameters) from my old domain to URLs (without parameters) on my new domain.
The URLs look like this:
old-domain.com/deceased-persons-2021/?id=1500_betty-white (id=1500_ ...
1
vote
3
answers
444
views
Changing URL structures via htaccess
sorry; have not done this since 2016, and kinda stumped. Need help with likely simple mod_rewrite rule for htaccess file to redirect old files which no longer have a trailing _number on the end.
Need ...
1
vote
1
answer
258
views
RewriteRule to Access Files Outside of Document Root
How do I write a RewriteRule that will access files outside of the document root?
We are running multiple sites on multiple subdomains using a shared hosting service. There are a number of core files ...
0
votes
0
answers
102
views
403 - Forbidden How can I try Track this down
I had someone gain access to the admin side of my OSCommerce installation and upload a Google verification file. That has been resolved but now unable to access the admin page/directory. I'm getting a ...
1
vote
1
answer
332
views
Block access to Parent Directory but not Sub Directory
I've been trying to block public access to a parent directory, but not the sub-directories inside it. Linux file permissions, don't seem to allow this, so I've been trying to use .htaccess to do so ...
2
votes
1
answer
429
views
Does .htaccess alone offer an authentication method that offers "remember me" and custom titles?
Basic authentication forgets the user once the browser is closed and browsers ignore its custom titles.
In my understanding Digest access authentication is not different in those aspects. So is there ...