I have various files for friends on my site that are listed under folders like mydomain.com/user/NAME I can make a wildcard subdomain so all subdomains will be the exact same as mydomain.com ; but how can I get the htaccess to react that way?
Basically I want NAME.mydomain.com to an alternative to mydomain.com/user/NAME
http://www.easymodrewrite.com/example-subdomains
Merry Christmas.
Thanks! BWF told me they'd set up wildcard, if I set up the htaccess.
Now to figure out how to make subdomain.mydomain.com match up with mydomain.com/user/subdomain
Would something like this work?:
Code:
- Options -Multiviews
- RewriteEngine On
- RewriteBase /
- # Force search engines to use mydomain.com
- RewriteCond %{HTTP_HOST} !^mydomain\.com$
- RewriteRule ^(.*) http://mydomain.com/$1 [R=301,L]
- # Specify search friendly URLs
- RewriteRule ^([a-z]+)\.mydomain\.com$ /users/$1 [L]
Edit: nevermind. No idea how the hell to use wildcards.
Did that code work? It should do - I remember setting this up for someone not long ago... Have you got this fixed?