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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -