httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Foster, Stephen (ASPIRE)" <steve.fos...@hmrcaspire.com>
Subject RE: [users@httpd] Help with re-write rules
Date Tue, 15 Aug 2006 07:30:17 GMT
Hi robert,

thanks for this, it has been a great help. It now serves the pages as i want
them without any extraneous entries in the log files. Our application
proxies directly to weblogic using the /home context which is why i want all
requests to land at that point except , obviously, for the heartbeat and
server-status pages.

many thanks for your input.

Steve


-----Original Message-----
From: Robert Ionescu [mailto:robsiegen@googlemail.com]
Sent: 14 August 2006 20:36
To: users@httpd.apache.org
Subject: Re: [users@httpd] Help with re-write rules


Foster, Stephen (ASPIRE) wrote:
> # =================================================
> # Rewrite to HTTPS Settings
> # =================================================
> RewriteCond %{HTTP_HOST}   !^online\.domain\.com [NC]
> RewriteCond %{HTTP_HOST}   !^$

Use lexicographically equal (!="") here instead of a regular expression
> RewriteRule ^/(.*)         http://online.domain.com:%{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]

Why are you using Server_Name, if you force this to be 
online.domain.com or online.domain.com:%{SERVER_PORT}. Should every 
request really go to /home?

I think you're looking for something like

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

-- 
Robert

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


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


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