![]() |
.htaccess redirect for subdomains
I am trying to make my site do this...
when cpanel creates a sub-domain it just puts the root folder of the sub-domain as a sub-folder of the primary domain on the account. so http://sub.domain.com would also be http://www.domain.com/sub/. but I want to make it where two things happen... if someone accesses a sub-domain with www, it rewrites the subdomain url without www, and also when someone accesses my subdomain as a sub-folder of the root domain, it also rewrites that and directs the user to the subdomain url. Anyone know how to do both or either? thanks for all feedback! regards, the G4E newbie |
Re: .htaccess redirect for subdomains
Quote:
Code:
Options +FollowSymlinksQuote:
|
Re: .htaccess redirect for subdomains
thank you. i will give it a shot and see how things go.
|
Re: .htaccess redirect for subdomains
Hi,
I am trying to redirect subdomain.mysite.com to mysite.com/index.php?id=subdomain passively so as the address in browser remains as subdomain.mysite.com . Below is the code from my .htaccess file. RewriteCond %{HTTP_HOST} !^www\.mysite\.com RewriteCond %{HTTP_HOST} ([^.]+)\.mysite\.com RewriteCond %{REQUEST_URI} !^/index\.php$ RewriteCond %{QUERY_STRING} !^id=. RewriteRule (.*) /index.php?id=%1 [L] I don't know why it's still not redirecting as wanted. Any Ideas ? Thanks |
Re: .htaccess redirect for subdomains
For Redirect the address bar will not remain as it is. It will change in the address bar.
|
Re: .htaccess redirect for subdomains
Yes , but its not even redirecting.
|
| All times are GMT +5.5. The time now is 10:56. |