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
|
Go4Expert Founder
|
![]() |
| 10Jan2007,11:36 | #2 |
|
Quote:
Originally Posted by sinasylum Code:
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST}//s%{HTTPS} ^www\.(.*)//((s)on|s.*)$ [NC]
RewriteRule ^ http%3://%1%{REQUEST_URI} [L,R=301]
Quote:
Originally Posted by sinasylum |
|
Newbie Member
|
|
| 10Jan2007,13:34 | #3 |
|
thank you. i will give it a shot and see how things go.
|
|
Newbie Member
|
|
| 11Aug2007,05:24 | #4 |
|
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 |
|
Go4Expert Founder
|
![]() |
| 11Aug2007,10:03 | #5 |
|
For Redirect the address bar will not remain as it is. It will change in the address bar.
|
|
Newbie Member
|
|
| 11Aug2007,20:59 | #6 |
|
Yes , but its not even redirecting.
|

