You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Daniel Abad <da...@cidadei.com.br> on 2002/03/15 19:06:22 UTC

MOD_REWRITE - URGENT!

Hi all!

I´m trying to configure Virtual Hosts using mod_rewrite, but I need to
redirect all URLs to my domain, like this:
http://www.test.com.br ->> http://test.mydomain.com.br


Take a look:

RewriteEngine on
RewriteCond %{HTTP_HOST}        !.*\.mydomain\.com\.br.*
RewriteRule ^(.*)               http://%{HTTP_HOST}.mydomain.com.br$1 [R]

VirtualDocumentRoot /path/vhosts/%1.1/%1.2/%1/htdocs



See the response from server:
"http://www.test.com.br.mydomain.com.br/index.html"



Someone knows how to configure Apache mod_rewrite to redirect to:
http://test.mydomain.com.br/index.html ???

 
Tks all!

Daniel.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: MOD_REWRITE - URGENT!

Posted by Martin Haase-Thomas <mh...@meome-ag.de>.

Daniel Abad wrote:

>Hi all!
>
>I´m trying to configure Virtual Hosts using mod_rewrite, but I need to
>redirect all URLs to my domain, like this:
>http://www.test.com.br ->> http://test.mydomain.com.br
>
>
>Take a look:
>
>RewriteEngine on
>
>RewriteCond %{HTTP_HOST}        !.*\.mydomain\.com\.br.*
>
no:
    RewriteRule (.*)     http://test.mydomain.com.br$1 [R]

>
>RewriteRule ^(.*)               http://%{HTTP_HOST}.mydomain.com.br$1 [R]
>
>VirtualDocumentRoot /path/vhosts/%1.1/%1.2/%1/htdocs
>
I wonder whether the backreferences from your rewrite condition will be 
visible outside of mod_rewrite.

regards
Martin

>
>
>
>
>See the response from server:
>"http://www.test.com.br.mydomain.com.br/index.html"
>
>
>
>Someone knows how to configure Apache mod_rewrite to redirect to:
>http://test.mydomain.com.br/index.html ???
>
> 
>Tks all!
>
>Daniel.
>
>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP Server Project.
>See <URL:http://httpd.apache.org/userslist.html> for more info.
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org
>
>

-- 
                   http://www.meome.de
-------------------------------------------------------
Martin Haase-Thomas         |       Tel.: 030 43730-558
meOme AG                    |       Fax.: 030 43730-555
Software Development        |           mht@meome-ag.de
-------------------------------------------------------




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org