.htaccess: subdomain to sub-folder

Posted by Oden on Stack Overflow See other posts from Stack Overflow or by Oden
Published on 2010-06-09T09:19:29Z Indexed on 2010/06/09 10:12 UTC
Read the original article Hit count: 206

Filed under:
|

Hey,
How can i redirect a subdomain call to a folder?

So when the site, sub.domain.com is requested, the name of the subdomain should point to a subfolder.

The server is configured to add every request to the domain, but i get a 404 page everytime i do a non-defined subdomain call (witch is trivial, because theres nothing defined)

EDIT
my request looks like this: sub.domain.com
What and i want to get that it works like a "virtual subdomain", because it has to request a folder with the same name that the subdomain. (domain.com/sub/)

So the question is:
How to solve this, with .htaccess?

© Stack Overflow or respective owner

Related posts about .htaccess

Related posts about mod-rewrite