Issue with permanent redirect implementation
- by Argoron
I have a tricky problem related to 301 redirections I badly need help with.
I tried to implement these via .htaccess, but ran into trouble.
The start of my .htaccess looks like this:
SetEnv PHP_VER 5
Options +FollowSymlinks
RewriteEngine on
# Redirect non-www to www
RewriteCond %{HTTP_HOST} !^(www\.|$) [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
#--- GENERAL ---
RewriteRule ^index\.html$ index.php [L]
...
When I try to put a permanent redirect to index.php by adding R=301 in the square brackets,
I get a 404, and I have no idea where the error comes from.