Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Let's say I have my web folder as public_html. In there I have a sub folder. I can view the folder at:

www.mydomain.com/sub & mydomain.com/sub

What I want is:

sub.mydomain.com

This will show the content of public_html/sub. How would I set up my rewrite rules to do this.

share|improve this question
    
This seems like a duplicate of this: stackoverflow.com/questions/1167068/… - useful info available there. FWIW, my suggestion is you create another virtual host pointing directly to the sub-folder rather than incur the overhead of the apache rewrites. –  Zayne S Halsall Feb 5 '11 at 12:41
add comment

1 Answer

You don't need any rewrite rules. Just add a VirtualHost section, like

<VirtualHost IPAddress>
    ServerName sub.mydomain.com
    DocumentRoot /path/to/public_html/sub
</VirtualHost>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.