ashkir Full Member
Posts: 1,159 Status: Offline Gender: Male Location: Cali! Age: 34 Joined:
pmskypemsnyahoo | wildcard subdomain htaccess (24th Nov 10 at 2:05am UTC) | | 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 | |
|
Marc vChat Developer
I <3 Rossy
Posts: 3,388 Status: Offline Gender: Male Location: Ontario, Canada Age: 31 Joined:
Additional Groups: Coding Team
pmwww | |
ashkir Full Member
Posts: 1,159 Status: Offline Gender: Male Location: Cali! Age: 34 Joined:
pmskypemsnyahoo | Re: wildcard subdomain htaccess (24th Nov 10 at 2:42am UTC) | | 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
| |
|
ashkir Full Member
Posts: 1,159 Status: Offline Gender: Male Location: Cali! Age: 34 Joined:
pmskypemsnyahoo | Re: wildcard subdomain htaccess (24th Nov 10 at 3:18am UTC) | | 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. | |
|
Michael Moderator
Recoding the future Posts: 4,043 Status: Offline Gender: Male Location: UK Joined:
Additional Groups: Coding Team
pmvForum | Re: wildcard subdomain htaccess (29th Nov 10 at 1:26pm UTC) | | Did that code work? It should do - I remember setting this up for someone not long ago... Have you got this fixed? | |
|