I am using two Domains which one of them is the Main Domain (http://www.domain.com) and the second is a Domain to shorten URL’s (http://doma.in)
Forwards should be like this
http://domain.com -> http://www.domain.com
RewriteCond %{HTTP_HOST} ^domain.com [NC]
RewriteRule (.*) http://www.domain.com/$1 [R=301,L]
http:// doma.in -> http:// www. domain.com
RewriteCond %{HTTP_HOST} ^doma.in [NC]
RewriteRule (.*) http://www.domain.com/$1 [R=301,L]
http://sub.domain.com -> http://sub.domain.com (no configuration needed?!)
and now the important one
http://doma.in/VC7s98X -> should forward to its target without to be converted to http:// www.domain.com
I dont know how I can do this part.
Your second set of rules matches everything (
(.*)) on the domain doma.in. To only match the bare domain without any trailing path, change the rule as follows:That takes care of
http://doma.in/VC7s98Xnot redirecting tohttp://www.domain.com. I’m assuming you have something in place to take care ofhttp://doma.in/VC7s98Xforwarding to its intended target … if you’re asking for help with that part, that’s a much bigger question.