Take the 2-minute tour ×
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 ^(.*)$ http://oomail.org/%1 [L]
</IfModule>

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

share|improve this question

migrated from stackoverflow.com Aug 10 '11 at 6:09

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

2 Answers 2

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

You can't use absolute urls

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

Your Answer

 
discard

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.