Good point well made, the current rules are as follows: non-secure handler: # ================================================= # Rewrite to HTTPS Settings # ================================================= RewriteCond %{REQUEST_URI} !=/heartbeat/heartbeat.htm RewriteCond %{REQUEST_URI} !=/server-status RewriteCond %{SERVER_PORT} !=443 RewriteRule ^/$ https://www.domain.com/home [R=301,L] RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC] RewriteCond %{HTTP_HOST} !="" RewriteCond %{REQUEST_URI} !=/heartbeat/heartbeat.htm RewriteRule ^/(.*) http://www.domain.com:%{SERVER_PORT}/$1 [R=301,L] Secure Virtual host: RewriteRule ^/$ https://www.domain.com/home [R=301,L] The backend application catches the /home part and assesses whether the client has already logged in and if not re-directs to /login which then returns the URL/URI given in the original email further down this thread. Hope that helps Steve -----Original Message----- From: jslive@xxxxxxxxx [mailto:jslive@xxxxxxxxx]On Behalf Of Joshua Slive Sent: 14 December 2006 15:07 To: users@xxxxxxxxxxxxxxxx Subject: Re: re-writing URI's On 12/14/06, Foster, Stephen (ASPIRE) <steve.foster@xxxxxxxxxxxxxx> wrote: > Hi there, > > i'm having a bit of trouble getting a rewrite rule for a URI to work. > Basically i have the following scenario, > > The user enters http://www.domain.com and this gets intercepted by another API and the browser gets a URL sent back with a URI added including the original URL of http://www.domain.com , my re-writing rules then re-write the first part to secure, i.e https://www.domain.com but the URI stays non-secure ,e.g http://www.domain.com > > so the outcome to the browser is: > > https://www.domain.com/login?APPURI=http://www.domain.com/home > > What i need to do when i re-write the first part to secure is also to intercept the URI and re-write this to secure if it comes back as non-secure, so i need the URL being sent back to the browser to appear as follows: > https://www.domain.com/login?APPURI=https://www.domain.com/home > > I know i can use the RewriteCond %{REQUEST_URI} context but need to be able to tell it to find "http:" and re-write this to "https:" wherever it appears in the URI in case the developers change it without me knowing. However if needs be then i can intercept "APPURI=http:" and rewrite this to "APPURI=https:" > > Does that make sense to anybody?? Sure, it should be a relatively straightforward regex with substitution. But I'm not going to try to guess at your entire config. Show us what you've got already and we can perhaps tell you what to add. Joshua. --------------------------------------------------------------------- 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@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx =========================================================== 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@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx