apache - multiple internal rewrites not working as expected -
i'm having .htaccess troubles.
i take following url: /index2/ internally rewritten to /index2.html
in .htaccess file have:
rewriteengine on rewriterule ^(.*)/$ $1.html [l]
but url evanjerkunica/index2/ says: requested url /redirect:/index2.html.html.html not found on server.
any idea why keeps getting rewritten internally? thank help!!
you need check html exists before apply rule. can condition:
rewriteengine on # extract pathname capture group rewritecond %{request_uri} ^/(.*?)/?$ # test see if pathname + .html exists file rewritecond %{document_root}%1.html -f # if both conditions true, apply rule: rewriterule ^(.*?)/?$ $1.html [l]
Comments
Post a Comment