Forum Moderators: phranque
[edited by: phranque at 10:08 pm (utc) on Aug 27, 2014]
[edit reason] removed link to buggy htaccess tester [/edit]
Your first rule has no condition set.
I am using a shared host so not sure I can use the RewriteLog directive for debugging
the index.html redirect is failing to redirect to the root
^(([^/]+/)*)index\.(php|html?)$ \.(php|html?)$ Do you mean that it works with inner directories, but not with requests for the root?
the only 301 being carried out is when example.com is input, in which case the redirect to www.example.com is working as intended
example.example.com
Can I assume there are no other htaccess files containing mod_rewrite further inside the subdirectory?
the only 301 being carried out is when example.com is input
RewriteRule foobar http://www.example.com/widget.html [R=301,L] they are not familiar with advanced apache rewrite rules and that I should check my code with a good programmer! lol. He said he is certain it is not an issue with the Apache configuration though, because the basic redirect rules are working. And in their view, an index.html redirect to the home was "impossible."
Does your htaccess currently contain redirects using mod_alias?
Use RedirectMatch to enable Regular Expressions with captures. But this isn't good practice because in htaccess mod_rewrite always executes before mod_alias, so you will end up with things happening in the wrong order at best. At worst, things will get thoroughly messed up.