Sign up ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Following is the content of .htaccess file

<IfModule mod_rewrite.c>
  Options +FollowSymLinks
  Options +Indexes
  RewriteEngine On
  RewriteBase /
  RewriteCond %{HTTP_HOST} ^(.+)\.oomail\.org$ [NC]
  RewriteRule ^(.*)$ [L]

My purpose is to map all subdomain to folder. For example if is opened it should show the content of But URL should not change.
But whenever I open URL is automatically getting changed. How can I prevent it?

share|improve this question

migrated from Aug 10 '11 at 6:09

This question came from our site for professional and enthusiast programmers.

2 Answers 2

You can't use absolute urls

RewriteCond %{HTTP_HOST} ^(.+)\.oomail\.org$ [NC]
RewriteRule ^(.*)$ /%1 [L]
share|improve this answer

It sounds like you want a reverse proxy. Fortunately, there's a flag to do this.

So you need to enable mod_proxy and add P to the RewriteRule flags.

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.