apache - Why does this RewriteRule produce infinite recursion? -
i trying rather basic url rewriting cannot running properly.
i want redirect requests wordpress.foobar.com
local symlinked wordpress installation via .htaccess
file:
rewriteengine on rewritecond %{server_name} ^wordpress\.foobar\.com$ rewriterule ^(.*) /html/wordpress/$1 [l]
while can access foobar.com/html/wordpress
, visiting wordpress.foobar.com
raise 500 internal server error.
apache's error log contain following:
[error] [client 12.123.123.123] request exceeded limit of 10 internal redirects due probable configuration error. use 'limitinternalrecursion' increase limit if necessary. use 'loglevel debug' backtrace.
when enable debug loglevel can see apache trying rewrite favicon.ico
infinitely, appending layer of /html/wordpress/
until recursion limit reached.
what's wrong rewrite?
when error request exceeded limit of 10 internal redirects due probable configuration error.
, ask question: how did design rules terminate @ point, , why not terminate.
in case, rule matches everything. status of condition not change either, if rule matches 1 time, match infinite amount of times. might work on setups if rewrite file exist. safer bet prevent rewriting more once testing if /html/wordpress/
in url:
rewritecond %{server_name} ^wordpress\.foobar\.com$ rewritecond %{request_uri} !/html/wordpress/ rewriterule ^(.*)$ /html/wordpress/$1 [l]
besides this, not sure if wordpress recognize rewritten url. figure out.
Comments
Post a Comment