Rewrite rule does not work internally

by Vietna   Last Updated January 13, 2018 01:00 AM

I have this rewrite rule running on server 1:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /web/$1 [QSA,L]

and it works fine and does an internal rewrite. But this rule on another server does not:

RewriteCond %{HTTP_HOST} ^example.com
RewriteRule ^(.*)$ /web/$1 [QSA,L]

it forwards the browser to example.com/web but it should do the same: an internal rewrite. What is the problem with the second code, is it because the condition asks for the http_host? Or is it possible that it happens because of any different Apache config on the second server?

Tags : rewrite


Related Questions


port RewriteRule from apache to nginx

Updated June 20, 2018 14:00 PM

converting htaccess url rewriting rules into nginx

Updated August 06, 2017 03:00 AM



Nginx Node Proxypass to Variable

Updated July 07, 2018 22:00 PM