RewriteRule ^([^/]+\.[^/]+)$ ./index.php?vwebsite=$1 [L]
I've got this going to get http://www.mydomain.com/anotherdomain.com to resolve in the background to http://www.mydomain.com/?vwebsite=anotherdomain.com.
However, now, I want all requests that go to http://www.mydomain.com/?vwebsite=anotherdomain.com in the browser to autmatically be 301'd to http://www.mydomain.com/anotherdomain.com so the URL is prermanently SEO friendly.
Trying the following, but clearly I am missing something!
- Code: Select all
RewriteCond %{QUERY_STRING} ^vwebsite=(.*)$
RewriteRule ^index\.php$ http://www.mydomain.com/$1? [R=301,L]
Thanks again, Richard.