Forum Moderators: phranque

Message Too Old, No Replies

Redirect https to http Apache

RedirectMatch rules and RewriteRule expressions

         

madmax

11:33 pm on Oct 13, 2003 (gmt 0)

10+ Year Member



Hi, I hope somebody can help me...

I have three domains in the same server and IP Address, the server is running SSL so itīs using 443 and 80 ports...the problem is that I need redirect two domains from https to http...as follow:

[domain1.com...]
[domain2.com...]
[domain3.com...]

I need to do this:
[domain1.com...] TO [main.com...]

[domain2.com...] TO [main.com...]

My configuration file httpd.conf looks like:

<IfModule mod_rewrite.c>
RedirectMatch ^/(index.html?)$ [domain3.com...]
RedirectMatch ^/some$ [domain3.com...]
RewriteLog logs/ssl_rewrite_log.some
RewriteLogLevel 80
RewriteEngine On
RewriteOptions inherit
RewriteRule ^//*some//*(.*)$ [domain3.com...]
? [NE,P,L]
</IfModule>

I will appreciate any help

Regards...

closed

1:20 pm on Oct 14, 2003 (gmt 0)

10+ Year Member



Welcome to WebmasterWorld [webmasterworld.com], madmax!

Something along these lines should work:


RewriteEngine On
RewriteCond %{SERVER_PORT} ^443$
RewriteCond %{HTTP_HOST} domain1\.com [NC,OR]
RewriteCond %{HTTP_HOST} domain2\.com [NC]
RewriteRule ^/some http://www.main.com [R,L]

Here are some references that might be helpful:
mod_rewrite [httpd.apache.org]
Regular expressions [etext.lib.virginia.edu]