I'm trying to redirect from:
mydomain.com/keyword or www.MyDomain.com/keyword
to:
www.mydomain.com/index.php?id=keyword
In all instances, I'd like to force WWW to be included in the final URL, and I'd like to force the URL to be in all lowercase.
So far, I've figured out how to include WWW when not included, and I've worked out how to add on 'index.php?id=', but I'm not having any success in having this work if they DO remember to add the WWW to the URL.
I have no idea how to force the entire URL to lowercase.
Here's what I have so far. I'm guessing I'm fairly far from the mark on this one?
- Code: Select all
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.mydomain.com$
RewriteRule ^(.*)$ http://www.mydomain.com/index.php?id=$1 [R=301]
Thank you for any help.