Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

Your Answer

 
discard

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