Forum Moderators: phranque

Message Too Old, No Replies

mod rewrite for HTTPS URL redirect

Moving SSL traffic for multiple DNS entries over a single hostname

         

cyoung

3:59 pm on Aug 19, 2005 (gmt 0)



This appears to be a simple problem but I cannot figure it out, so hopefully someone can help. I am not sure if mod rewrite is the appropriate solution.

I am attempting to redirect all traffic to use a particular hostname and SSL. There are multiple DNS entries for the server:

example.org
example.com

I want to redirect all http and https traffic on all DNS entries to be redirected to https on example.com.

I have the following entry in my httpd.conf file:

RewriteEngine on
RewriteRule ^/(.*)$ [example.com...]

If someone hits

http://example.com
http://example.org
[example.com...] (obviously)

the desired redirect behaviour is achieved.

If someone enters [example.org,...] the server performs no redirection. The user is able to view the web content, but retains the original URL.