httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m <ma...@ftsi.fujitsu.com>
Subject [users@httpd] Want to go between http and https with RewriteRule
Date Wed, 02 Jul 2003 16:57:26 GMT
Hi,

I have installed Apache 2.0.46 with OpenSSL 0.9.7b. I have installed my 
test certificate, and I’d now like to configure my site so that certain 
pages, e.g. login are served up with https, but the majority are served 
up with http.

I have configured two virtual hosts, one in httpd.conf to listen on port 
80, the other in ssl.conf to listen on 443. So far I can access my site 
through both https and http, so to me, that means both virtual hosts are 
working. (I am using proxypass and proxyreversepass in the virtual hosts).

Now I’d like to start being selective. To get the ball rolling I thought 
I’d put a simple condition in to serve everything as https, using 
RewriteCond and RewriteRule. Nothing happens! I have included the full 
virtual hosts below, (though I have removed the IP addresses). Nothing 
gets written to the rewrite_log

RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [L,R]



<VirtualHost xxx.xxx.xxx.xxx:80>

ProxyPass /fts_patch_errors !

RewriteEngine on

RewriteLog /var/apache/logs/rewrite_log
RewriteLogLevel 5

RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [L,R]

ProxyPass /portal-uat/fts http://avanti.eng.mydomain.com:2080/portal3/fts
ProxyPassReverse /portal-uat/fts/ 
http://avanti.eng.mydomain.com:2080/portal3/fts/

ProxyPass /portal-uat http://avanti.eng.mydomain.com:2080/portal3/fts
ProxyPassReverse /portal-uat 
http://avanti.eng.mydomain.com:2080/portal3/fts/

ProxyPass /portal-uat/ftsadmin 
http://avanti.eng.mydomain.com:2080/portal3/ftsadmin
ProxyPassReverse /portal-uat/ftsadmin/ 
http://avanti.eng.mydomain.com:2080/portal3/ftsadmin/

ProxyPass / http://avanti.eng.mydomain.com:2080/portal3/fts/
ProxyPassReverse / http://avanti.eng.mydomain.com:2080/portal3/fts/


# Directertory for HTML Error docs
<Directory "/export/home/http/htdocs/silverstream">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>


# Alias pointing to Error Docs Directory
Alias /fts_patch_errors/ "/export/home/http/htdocs/silverstream/"

# Error Document Directive
ErrorDocument 502 /fts_patch_errors/HTTP_BAD_GATEWAY.html

</VirtualHost>



<VirtualHost xxx.xxx.xxx.xxx:443>


SSLEngine on
SSLCipherSuite 
ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile /usr/local/certificates/server.crt
SSLCertificateKeyFile /usr/local/certificates/server.key

SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0

ErrorLog /var/apache/logs/error_log
TransferLog /var/apache/logs/access_log
CustomLog /var/apache/logs/ssl_request_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"


ProxyPass /fts_patch_errors !

ProxyPass /portal-uat/fts http://avanti.eng.mydomain.com:2080/portal3/fts
ProxyPassReverse /portal-uat/fts/ 
http://avanti.eng.mydomain.com:2080/portal3/fts/

ProxyPass /portal-uat http://avanti.eng.mydomain.com:2080/portal3/fts
ProxyPassReverse /portal-uat 
http://avanti.eng.mydomain.com:2080/portal3/fts/

ProxyPass /portal-uat/ftsadmin 
http://avanti.eng.mydomain.com:2080/portal3/ftsadmin
ProxyPassReverse /portal-uat/ftsadmin/ 
http://avanti.eng.mydomain.com:2080/portal3/ftsadmin/

ProxyPass / http://avanti.eng.mydomain.com:2080/portal3/fts/
ProxyPassReverse / http://avanti.eng.mydomain.com:2080/portal3/fts/

# Directertory for HTML Error docs
<Directory "/export/home/http/htdocs/silverstream">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>

# Alias pointing to Error Docs Directory
Alias /fts_patch_errors/ "/export/home/http/htdocs/silverstream/"

# Error Document Directive
ErrorDocument 502 /fts_patch_errors/HTTP_BAD_GATEWAY.html
</VirtualHost>




---------------------------------------------------------------------
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