Hello Can this be done in .htaccess 1. When someone requests www.mydomain.com/this is a test/ that he is redirected to www.mydomain.com/thisisatest/ 2. When someone requests www.mydomain.com/this is a test/ that he is redirected to www.mydomain.com/this-is-a-test/ Thank You for your response
Which do you want, this-is-a-test/, or thisisatest/? You can't redirect a visitor to two different URLs. You can only make both of the URLs show the this is a test/ stuff, or redirect to one URL. Even better, change the script to add - to spaces in URLs. Search and replace would do it.
thisisatest, would better suit me If you could write the code it would be apreciated, all my experimenting didn't make the trick
I'm not sure how well spaces go with mod_rewrite. Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^([^.]+) ([^.]+) ([^.]+) ([^.]+)/$ http://www.domain.com/$1$2$3$4/ [R=301,L] RewriteRule ^([^.]+) ([^.]+) ([^.]+)/$ http://www.domain.com/$1$2$3/ [R=301,L] RewriteRule ^([^.]+) ([^.]+)/$ http://www.domain.com/$1$2/ [R=301,L] If this is from a script, I think the normal RewriteRule ^([^.]+) ([^.]+) ([^.]+) ([^.]+)$ whatever.php?cat=$1&subcat=$2&page=$3 [L] would also need to be in the code.