All Questions
3,520
questions
1
vote
1
answer
39
views
How to redirect an url with a specific folder to another, whatever the page?
I tried for hours to redirect in an htaccess every pages of a folder to new url, matching the folder but it seems I definitely do not understand nothing to regex and redirect !
I want to redirect any ...
0
votes
0
answers
20
views
LocationMatch regex, a directory + front page
I want to proxy everything except front page and /images/* to another server with password. I wrote
<LocationMatch "^/$|^/(?!images/)">
AuthType basic . . .
ProxyPass "http://...
0
votes
1
answer
31
views
Wildcard in a Require expr in Apache
I'm trying to set up a Require expression in my Apache config to forbid users from accessing any file in a directory except specific types of files.
When accessed over the internet, everything else ...
2
votes
1
answer
56
views
Special access rule in an .htaccess file for IP addresses, authorized only for one directory structure
I have been dealing with WordPress for many years, but have a delicate problem with an access rule that I want to store in .htaccess. I use actually Apache 2.4.56.
Initial situation 1: The web server ...
1
vote
1
answer
72
views
How to ignore case in regexp mapping in a .htaccess rewrite rule? [duplicate]
What I have now is the following:
RewriteRule ^([^/]+)/*$ x/$1.html [L,NC,END]
This would point:
/abcd to x/abcd.html
/ABCD to x/ABCD.html
which would not be fine on a Unix file system that is ...
0
votes
0
answers
156
views
htaccess config to serve jxl / avif if file exist
I want to configure the htaccess file on a wordpress installation / apache server to serve a JpegXL if the browser supports it and if not serve a .avif file. If both formats are not supported serve ...
0
votes
1
answer
48
views
mod rewrite split and replace
I need an internal redirect, where category-slug is a dynamic value,
that schould be appended after the ~
/category/**category-slug** /blog/?ucterms=category~**category-slug**
Is that possible with ...
0
votes
1
answer
43
views
Regexp change with Substitute apache instrument in htaccess
I want to change strings on my site pages like:
<hr style="width:50%;">
<center>
to:
<hr style="width:50%;"><p class="somenew&...
2
votes
2
answers
64
views
htaccess - rewriting API requests to "api.php" and other requests to "web.php"
I'm testing some stuffs on Apache server and PHP. at the root of my project, I have this
.htaccess configuration file:
RewriteEngine On
RewriteBase /react/
# API requests
RewriteCond %{REQUEST_URI} ^/...
0
votes
1
answer
96
views
Why doesn't my PHP blocking .htaccess rule work?
I'm using Apache and I have this .htaccess file:
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/...
2
votes
2
answers
76
views
Need apache regex config for rewrite rule
Here is a scenario of what I am trying to do.
Folder A has folders B and C.
Folder B has D, E and index.html.
Folder C has index.html
I declared folder B as my DocumentRoot. Declared an Alias for ...
0
votes
0
answers
42
views
Apache folder redirect to a subfolder, without invalidating direct access to the subfolders
I have this directories structure:
www
-- subfolder
---- .htaccess
---- folder1
-------- file1.jpg
---- folder2
-------- file2.jpg
---- folder3
-------- file3.jpg
What should I type in the "....
2
votes
1
answer
213
views
Bitnami Apache rewrite Rewrite Cond and Rule
I would really appreciate some help in rewriting something.
I have moved a site to a sub domain and now the links to that site are not working.
The link before was:
https://www.domainname.com/folder/...
0
votes
1
answer
99
views
htaccess rewrite condition 404 all querystring only on index page
i was trying to protect the main page because on google console my report on a querystring is visible like this example:
https://example.com/?s=something.g
i would like to 404 all querystring only on ...
0
votes
0
answers
29
views
Apache2 VirtualHost : deny root URL but allow path
I am using below to block accessing the root URL... and trying to only allow access if visited path or with anything after root domain...
# Redirect root domain to a 403 Forbidden error
<Location &...