Hi, I've been reading alot about re-directing subdomains to directories, and have tryed various examples on my webserver, unfortunately nothing works. Basically what I'm trying to do is redirect something like: http://subdomain.website.com/page.html to http://www.website.com/~subdomain/page.html I want to ensure that the page the user is currently visiting is maintained, so that they can type that in using the subdomain initial subdomain method. Unfortunately, I do not have access to a shell account through my host, so I need to create a mod_rewrite rule to do this. Any help is appreciated, Thanks.
Hm...not answered. I've tried a couple of combinations with .htaccess but not been able to get it to work so far. EDIT: Okay, got it now, I *think* - into your .htaccess at your root:
Hi Here is what I want to do. I want to have any subdomain that is called be rerouted to my /home/site.com/httpdocs/index.php I want the urls http://something.domain.com to be routed to the same folder as http://domain.com But I want subdomains to be created on the fly. so I cant symbolically make folders for all of them ln /home/site.com/something(source) /home/site.com/httpdocs(target) because i want subdomains to be automatically created. in my index.php file I just want to detect the subdomain and use it as a var How do I get dns to route any dynamic subdomain to the proper ip and how do i get mod rewrite to foward any requests for a domain to one folder Thanks Atapi
Hi. Here's what you gave: RewriteEngine on RewriteCond %{HTTP_HOST} ^subdomain.website.com$ [OR] RewriteCond %{HTTP_HOST} ^www.subdomain.website.com$ RewriteRule ^(.*)$ http://www.webside.com/subdomain/ [R=301,L] And this works, except that the redirection is visible. What if I want to have hidden redirection? I don't know if this made any difference, but I removed the ~ from ~subdomain, and you had "http://http://" in the url on the 4th line. Thanks, N