I urgently need the following .htaccess file:
As my host doesn't automatically support the creating of subdomains, I want to setup a .htaccess file for that. He said, that he can enable for forwarding for *.mydomain.com to www.mydomain.com. Now I need a .htaccess file which regognizes the URL a visitor came from and forwards him to www.mydomain.com/directory.
So when a user types in:
He gets redirected to:
[mydomain.com...]
Would be great if anyone of you has this script.
Will this be possible too using .htaccess?
[i.can.write.anything.here.mydomain.com...]
to
[mydomain.com...]
???
Thanks a lot!!!
*.mydomain.com goes to www.mydomain.com
So as I am not a .htaccess guru, how can I change the following .htaccess file, so that it works for all subdomains?
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www\.)?whatever\.yourname\.com$ [NC]
RewriteCond $1 !whatever/
RewriteRule ^/?(.*)$ /whatever/$1 [L]