Forum Moderators: phranque

Message Too Old, No Replies

rewrite htttps query

Unsure whether my code is right to change https to https:444

         

chrism

11:12 am on Apr 19, 2004 (gmt 0)

10+ Year Member



Basically I think I have got my rewrite rule correct but I can't afford for the server to be unhappy about it so ask if someone could check it for me. Also tho I read through all the info on Apache 1.3 URL Rewriting Guide I am still not sure what the [L], [R] etc mean on the rules

The problem is that SSL only works at the moment on [mysite.com:444...]

and some proxy server are unhappy with the 444 bit so I want a rewrite rule that takes
[mysite.com...] and realises it as [mysite.com:444...]

so this is what I came up with

RewriteCond %{SCRIPT_URI} ^https:([^:]*)\/(.*)$
RewriteRule ^https:([^:]*)\/(.*) https:$1:444\/$2 [L]

am I anywhere near the mark?

[edited by: jdMorgan at 2:43 am (utc) on April 20, 2004]
[edit reason] Fixed BBcode smilies in regex [/edit]

jdMorgan

3:03 am on Apr 20, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



chrism,

For info on the [R] and [L] flags, see the mod_rewrite documentation [httpd.apache.org].

> and some proxy server are unhappy with the 444 bit so I want a rewrite rule that takes
[mysite.com...] and realises it as [mysite.com:444...]

If you use this approach, you'll have to do an external redirect, and so the proxies would still have to pass the URI, and they'll still be unhappy.

Can you use: [mysite.com[b]...] - Map the port number to a specific subdirectory? This takes the port number out of the domain part of the URI and moves it into the filepath part, where it won't affect proxies or DNS.

Jim