Questions tagged [mod-rewrite]

mod_rewrite is an Apache module that allows for server-side manipulation of requested URLs.

For an introduction and examples of using mod_rewrite, read over the comprehensive article,
"Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask"

2224 questions
1
vote
1 answer

Difficulty accessing folders .htaccess

I need to migrate a site running on Prestashop 1.6.1.10 to the latest version. I have a problem: I uploaded the new version to a new folder called shop, but I can't access it due to .htaccess. Here is the content of the current…
1
vote
1 answer

Apache Rewrite Whirlwind

I have inherited an environment where they used a re-write rule to redirect 1400+ clients with HTTPD/Apache. I am looking to add a subdomain for development (so a multi level subdomain) and I am getting "Passed 10 internal redirects" I am hoping I…
1
vote
0 answers

Redirect/Rewrite for directory if it contains a certain file extension inside

I have been stuck on this issue and have not been able to find a solution. I am using Apache 2.4.41. I am attempting to create a RewriteRule on a site if the currently viewing folder has any files inside with a certain file extension (for this…
Ookinder
  • 11
  • 2
1
vote
1 answer

How can i write a simple rewrite rule in htacess for a file in the sites root directory?

Ive been trying to get my sites htacess to provide effective rewrites for my filepages but im doing something wrong. My directory structure is very simple. All my files are in the root folder. So far my htacess looks like this. RewriteEngine…
1
vote
1 answer

Apache ProxyPass + RewriteRule?

I've set up an apache config to try to redirect /login and to ProxyPass all other requests: RewriteEngine on RewriteCond "%{REQUEST_URI}" "^/login$" RewriteRule "^/login$" "https://sub.example.org/$1" [L,R] SSLProxyEngine on ProxyRequests…
JellicleCat
  • 294
  • 2
  • 4
  • 17
1
vote
1 answer

Apache FilesMatch (global config) priority over local .htaccess

I want to protect all Wordpress admin interfaces (wp-login.php/wp-admin) in my server. To do this, I want to create a global config in Apache, asking for a fixed user/password (HTTP basic authentication), before reach the real WordPress login page.…
Arvy
  • 131
  • 8
1
vote
1 answer

Htacess Helicon APE false positive 403 Fail

Instead of using web.config for my rewrite rules, I have been using Helicon APE for emulating Apache's .htaccess feature. I have a large universal .htaccess file that is applied across the server as part of a feature to restrict access to passing…
imvain2
  • 123
  • 4
1
vote
1 answer

Apache - redirect without changing URL in user's browser

Is there a way to redirect with mod_rewrite without changing the URL in the user's browser? I saw a solution using [P] in the end of RewriteRule, but this is not working for me. What I want: https://my-server.com/propostas/billy.joe < --->…
deejah
  • 33
  • 4
1
vote
1 answer

Wordpress "There has been a critical error on your website"

I am getting the following error on the login page on our Wordpress site: There has been a critical error on your website. Please check your site admin email inbox for instructions. After searching the internet and log files, I believe it is caused…
Mike
  • 41
  • 2
  • 8
1
vote
1 answer

Apache VHost redirect aliases to HTTPS

I'm trying to do Virtualhosts on my "playground" VPS. I need it to redirect 3 or more domains to the main one. Also it should redirect HTTPS, Lets Encrypt is configured and working well. In current state, this config works fine, BUT when user goes…
1
vote
1 answer

Apache: Dynamic Reverse Proxy

is it possible to have an Apache server dynamically proxy all requests defined by a subdir? Like: https://proxy.example.com/host1 -> https://host1.example.com https://proxy.example.com/host2 ->…
1
vote
1 answer

How does Apache mod_rewrite work to restrict by IP

I would like to accept only certain IP(s) for a few weeks. Only accepted IP could load this -> www.example.com/login not the others. Apache 2.2 is used. The code in mod_rewrite as below : RewriteMap hosts-allow txt:/conf/hosts-allow RewriteCond…
Katy
  • 13
  • 4
1
vote
0 answers

Apache mod_rewrite P flag is rewriting URL unexpectedly

I've recently received a request from the site owner to redirect our base domain to a specific landing page on a subdomain, which is working just fine. The problem is that he wants the URL to remain the same, so the user will see mydomain.com but go…
1
vote
0 answers

Apache2: RADIUS authentication before rewrite engine HTTPS

I tried to set up a reverse proxy with HTTPS and Radius authentication. Unfortunately, I don't get an authentication query before it redirects to the HTTPS page. What did I do wrong? Require all granted …
1
vote
1 answer

Adding Wordpress .htaccess code to Apache config (for all sites)

The default .htaccess code for WordPress is: RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] How…
Joe
  • 13
  • 3