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} ^
RewriteRule ^(.*)$ /web/$1 [QSA,L]

it forwards the browser to 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

converting htaccess url rewriting rules into nginx

Updated August 06, 2017 03:00 AM

nginx rewrite : [emerg] unknown "0" variable

Updated December 14, 2017 15:00 PM