to redirect any .html page to / ending page but it also redirecting the example.com/ to example.com/index/
help to solve it please thank you
g1smd
10:31 am on May 12, 2012 (gmt 0)
Use a RewriteRule, not RedirectMatch. Add the [R=301,L] flags.
Set up a separate preceding rule that deals with index requests (redirect index.html requests to URL ending with slash).
URLs for pages should not end with a slash. URLs ending with a slash denote a folder.
Add a preceding RewriteCond checking THE_REQUEST to be sure that when the pointer is set to .html this is as a result of a direct request and not as a result of a previous internal rewrite.
kfaer
10:37 am on May 12, 2012 (gmt 0)
could you please how the should looks
incrediBILL
7:38 pm on May 12, 2012 (gmt 0)
This whole forum is full of such examples, many many of them.
to redirect any .html page to / ending page but it also redirecting the example.com/ to example.com/index/
Been there. Done that. It means mod_dir has already executed, so URLs ending in / have been rewritten (not redirected) to index.html. When you change to mod_rewrite you will be able to add Conditions. You need one looking at THE_REQUEST.