I am trying to use Apache redirects to change directories between my production and test folders if I use subdomain < On code> test such as test.mywebsite.com I think it gets entangled in an infinite loop. I'm sure this is something easy but I can not understand it.
& lt; Directory / & gt; RewriteBase rewrite code on / var / www / mywebsite% {HTTP_HOST} ^ test \. [^.] + \. Com $ RewriteRule ^ (. +)% {HTTP_HOST} $ 1 [C] RewriteRule (. *) / Var / www / Mywebsite_dev & lt; / Directory & gt; Edit I am getting errors in Apache log like this.
The request exceeded the limit of 10 internal redirects due to a possible configuration error. Use 'LimitInternalRecursion' to increase the range if necessary Use 'log-level debug' to get backtracks. R-> Redirect from URI = / mywebsite_dev / mywebsite_dev /> R-> Redirect from uri = / mywebsite_dev /> R-> If you explicitly test subdomain If you are checking, do not use RewriteBase . REVRITTENGIN ON REVRICTOND% {HTTP_HOST} ^ test \. [NC] Rewrite $ 1! ^ /? Mywebsite_dev / [NC] rewrite ^ (. *) $ / Mywebsite_dev / $ 1 [L] In addition, a RewriteRule to www < Code> or public_html dir, therefore, do not provide an absolute system file path because the resulting final path would be incorrect.
No comments:
Post a Comment