View Single Post

  #1 (permalink)  
Old 01-25-2007
jeremy.parrott@gmail.com
 
Posts: n/a
Default Help Creating a Rewrite Condition

I have minimal knowledge on apache or making configuration changes, so
if you could reply and break it down Barnie style I would appreciate
it.

Here's the problem. I had a simple redirect on my web site that would
send everyone going to http://mysite.com to https://mysite.com and it
worked great, but if someone were to type in http://mysite.com/listing
then they would not get redirected to the https site.

>From this we created a rewrite rule that looked like this (if there's

anything wrong with this, please let me know):

RewriteCond %{REMOTE_HOST} !^IPADDRESSOFSERVER/$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1
<https://%{HTTP_HOST}/$1>[NC,R,L]

This seems to be working for site requests, but what we need to
accomplish is have all users get redirected to the https site except
for the local host. The local host still needs to communicate on port
80 for some web features, but isn't able to with what we have in place.
(Should IPADDRESSOFSERVER be localhost, 127.0.0.1, or the actual IP of
the Server?)

If anybody has any suggestions on how to get this working please let me
know.