Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

14
  • 3
    Ansari's solution will work, however, it when I navigate to http://test.domain.com, the URL redirects me to http://test.domain.com/subdomains/test/. Is it possible without showing the /subdomains/test/ at the end? Commented May 17, 2012 at 20:26
  • 2
    In that case, I believe you will have to look into using mod_proxy and specify a P flag in addition to the L. Commented May 17, 2012 at 20:39
  • 2
    No, it redirects to http://test.domain.com/subdomains/test/, when I only want it to show http://test.domain.com/ Commented May 17, 2012 at 20:53
  • 1
    I can't see how it redirects to test.domain.com/subdomains/test - maybe there is something else going on here. Can you add RewriteBase / right after RewriteEngine on? Also, if you want to keep it showing test.domain.com you will have to use mod_proxy and the [P] flag. Commented May 17, 2012 at 20:59
  • 1
    I was able to get it to work using @anubhava's answer here: stackoverflow.com/a/22395008/128984 Commented Feb 23, 2016 at 19:07