httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nelson, Robert D." <RDNel...@Mail.Donaldson.com>
Subject [users@httpd] rewriting http to https
Date Wed, 02 Oct 2002 21:12:35 GMT
Everyone:

I'm having trouble getting a mod_rewrite statement to work.  Basically, I
want any request that comes in for a particular virtual host to be rewritten
to use https.  For example, http://www.domain.com/foo/bar should be
rewritten to https://www.domain.com/foo/bar.

I currently have it set up as a virtual hosts like this...

<VirtualHost 1.2.3.4:80>
	ServerName www.domain.com
	ServerAdmin webmaster@domain.com
	DocumentRoot /location/of/doc/root

	RewriteEngine on
	RewriteRule  ^/(.*)  https://www.domain.com/$1   [R,L]
	RewriteLog   /location/of/logs/rewrite_log
</VirtualHost>

<VirtualHost 1.2.3.4:443>
	ServerName www.domain.com
	ServerAdmin webmaster@domain.com
	DocumentRoot /location/of/doc/root
	SSLEngine on
	SSLCertificateFile /location/of/cert/domain-com.crt
	...
</VirtualHost>

I don't get any errors when I bounce Apache with these settings.  When I go
after the domain via http, I get a "document contains no data" in Netscape
(4 and 7), and "Cannot find server or DNS Error" in IE.  Logs are not being
written to the rewrite_log when I hit the site via http.  The domain can be
reached via https with no problem.

I've read and reread the documentation and I can't seem to figure out the
problem.

I'm running Apache 1.3.19 on HP-UX 11.11.

Any help or pointers to relevant documentation/examples are appreciated.
Thanks in advance for any help.

 ~ Robert


"There are only 10 types of people in this world: Those who understand
binary, and those who don't."


---------------------------------------------------------------------
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
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message