vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Programming Discussion :: wildcard subdomain htaccess - View Topic
Topic Rating: *****
Printable View
ashkir
Full Member
***

[Avatar]

Posts: 1,158
Status: Offline
Gender: Male
Location: Cali!
Age: 31
Joined:  
Reputation: 42%  


pmtwitterskypemsnyahoo
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,386
Status: Offline
Gender: Male
Location: Ontario, Canada
Age: 28
Joined:  

Additional Groups:
Coding Team
***


Reputation: 40%  


pm
Re: wildcard subdomain htaccess (24th Nov 10 at 2:38am UTC)
http://www.easymodrewrite.com/example-subdomains

Merry Christmas. {Smile}

Image

Image
Current Status: Private BETA testing.
ashkir
Full Member
***

[Avatar]

Posts: 1,158
Status: Offline
Gender: Male
Location: Cali!
Age: 31
Joined:  
Reputation: 42%  


pmtwitterskypemsnyahoo
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
***

[Avatar]

Posts: 1,158
Status: Offline
Gender: Male
Location: Cali!
Age: 31
Joined:  
Reputation: 42%  


pmtwitterskypemsnyahoo
Re: wildcard subdomain htaccess (24th Nov 10 at 3:18am UTC)
Would something like this work?:

Code:
 
  1. Options -Multiviews
  2.  
  3. RewriteEngine On
  4. RewriteBase /
  5.  
  6. # Force search engines to use mydomain.com
  7. RewriteCond %{HTTP_HOST} !^mydomain\.com$
  8. RewriteRule ^(.*) http://mydomain.com/$1 [R=301,L]
  9.  
  10. # Specify search friendly URLs
  11. RewriteRule ^([a-z]+)\.mydomain\.com$ /users/$1 [L]
 




Edit: nevermind. No idea how the hell to use wildcards.
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
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? {Smile}
 Printable View

All times are GMT+0 :: The current time is 7:53am
Page generated in 0.1656 seconds
This Forum is Powered By vForums (v2.4)
Create a Forum for Free | Find Forums