I need to create subdomain redirect with .htaccess but I do not know how to do it. I exactly want http://[B]xyz[/B].mydomain.com to http://www.mydomain.com/page=xyz Can any one advise me rewrite tags about it?
This should work fine for you. RewriteEngine On RewriteCond %{HTTP_HOST} ([^.]+)\.mydomain.com [NC] RewriteRule ^(.*) http://mydomain.com/index.php?page=%1 [P] Code (markup): Not tested. mckST
You may have to do it through your CPanel if you do not have complete control over the domain / site. If so goto your cpanel, then goto Subdomains, and your there
what error do you get? try page=$1 instead of %1 if you get 404 its probably a spelling mistake or something to do with the page its lookin up, if its an internal server error then its the rule itself
here is the code i use: maybe worth trying it instead RewriteCond %{HTTP_HOST} ^www.xxx.com RewriteRule (.*) http://xxx.com/$1 [R=301,L] Code (markup):