httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Foster, Stephen (ASPIRE)" <>
Subject [users@httpd] Help with re-write rules
Date Mon, 14 Aug 2006 15:54:50 GMT
hi all,

quick newbie question if i may. I have been playing about with re-write
rules today in order to acheive the behaviour i want, the situation i
currently have is that i need to match and effect the following:

1: All requests to something other than the the FQDN should be written to
the FQDN. e.g customer access site using , i rewrite
customer to
2: All requests that are non-secure are written to secure. e.g URL becomes
3: i must be able to support non-secure requests to certain URL's e.g and

The current ruleset i am using is as follows:

# =================================================
# Rewrite to HTTPS Settings
# =================================================
RewriteCond %{HTTP_HOST}   !^online\.domain\.com [NC]
RewriteCond %{HTTP_HOST}   !^$
RewriteRule ^/(.*){SERVER_PORT}/$1 [R]
RewriteCond %{REQUEST_URI}  !^/heartbeat/heartbeat.htm
RewriteCond %{REQUEST_URI}  !^/server-status
RewriteCond %{SERVER_PORT}  !^443$
RewriteRule ^/(.*)$ https://%{SERVER_NAME}/home [R,L]

This works mostly right and will serve the non-secure URL's properly,
however they are then continuing on to process the rule for 80->443 , but
not actually re-directing the browser, but does appear in the access logs.
Any help on the right way forward for this would be great.

many thanks in advance


Steve Foster | Capgemini | Telford
Shared Technology Services
T. +44 (0) 1952 296664 |
Internal: 46664

Join the Collaborative Business Experience 

Our e-mail domain has now changed from to Please update your
address books.

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message