Okay so im trying to redirect from
http://domain.com/ to http://www.domain.com/
http://domain.com/name1 to http://www.domain.com/name1
so that all non-www urls go to www urls.
also im trying to redirect from
http://www.domain.com/name1/ to http://www.domain.com/name1
http://domain.com/name1/ to http://www.domain.com/name1 (no www and unwanted
trailing slash)
so that unwanted trailing slashes on these variables are 301 redirected to
urls without the slash.
Additionally i wanted to organize my site so that categories are redirected
to:
http://www.doimain.com/+london to http://www.doimain.com/index.php?r=london
http://www.doimain.com/+london+restaurant to
http://www.doimain.com/index.php?r=london&c=restaurant
http://domain.com/name1 to http://www.doimain.com/index.php?d=name1
After alot of googling i came up with the rewrite code in my .htacces:
------------------------------------------------------------------------
Options +FollowSymLinks
RewriteEngine On
# Redirect from non www to www version of domain
RewriteCond %{HTTP_HOST} ^domain.com
RewriteRule (.*) http://www.domain.com/$1 [R=301,NC]
# Redirect to remove trailing slashes on extensionless URL requests
# If requested URL ending with slash does not resolve to an existing directory
RewriteCond %{REQUEST_FILENAME} !-d
# Externally redirect to remove trailing slash
RewriteRule ^(.+)/$ http://www.domain.com/$1 [R=301,NC]
# Redirect pages
RewriteRule ^+([a-z0-9]+)+([a-z0-9]+)$ index.php?r=$1&c=$2 [NC,L]
RewriteRule ^+([a-z]+)$ index.php?a=$1 [NC,L]
RewriteRule ^([a-z0-9]+)$ index.php?d=$1 [NC,L]
-----------------------------------------------------------------------------
But it dosnt seem to work
help please!!
Thanks
max