Apache Redirect Rule Always fires on every request
-
10-07-2019 - |
Question
So the following rewrite rules always seem to fire. This has the effect of hiding another domain that I am hosting on the server?
I can't seem to figure out what's wrong and it is time to call in the experts:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^danielhonig.com
RewriteRule ^(.*)$ http://www.danielhonig.com/$1 [R=permanent,L]
RedirectMatch ^/$ http://www.danielhonig.com/gravl
Options None
No correct solution
OTHER TIPS
Place the rewrite rules inside your <VirtualHost>
directive, then it will not affect your other domain.
Did you try using %{SERVER_NAME}
instead of %{HTTP_HOST}
? I've found %{SERVER_NAME}
plays nice with sub domains too.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow