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
Use the following Code: Options +FollowSymlinks RewriteEngine On RewriteCond %{HTTP_HOST}//s%{HTTPS} ^www\.(.*)//((s)on|s.*)$ [NC] RewriteRule ^ http%3://%1%{REQUEST_URI} [L,R=301] Use a hardcoded one for the domain and for the files have a wildcard.
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