Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
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 ...
Tim's user avatar
  • 27
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://...
Jori Mäntysalo's user avatar
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 ...
QuestionAsker1995's user avatar
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 ...
Besim's user avatar
  • 21
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 ...
Chong Lip Phang's user avatar
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 ...
konrad's user avatar
  • 1
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 ...
joe king's user avatar
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&...
Krechet USA's user avatar
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} ^/...
Emmanuel Vianney's user avatar
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/...
Tudvari's user avatar
  • 2,855
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 ...
vijay's user avatar
  • 33
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 "....
Resiel's user avatar
  • 21
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/...
Josh Hawkes's user avatar
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 ...
Dhon Collera's user avatar
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 &...
Sajjad Hossain Sagor's user avatar

15 30 50 per page
1
2 3 4 5
235