PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > alt.apache.configuration > SSL Redirect
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
alt.apache.configuration Apache web server configuration issues.

SSL Redirect

Réponse
 
LinkBack Outils de la discussion
Vieux 03/10/2006, 15h02   #1
lark
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut SSL Redirect

Hello All,

I do not think that I have a unique situation and/or configuration
problem but for some reason I can't find anything on this problem out
there.

Here's the problem:

I have a single apache (1.3) server with an ssl site configured
correctly on port 443. We have an intranet environment where it is
acceptable to connect to this apache server on port 80 but this server
also serves ineternet requests and I want all those requests to
automatically roll over to port 443.

So for example if the request is coming from an ip address that looks
like this "10.5.100.200" it may go to port 80 but any other requesting
ip address (other than starting with 10.x.x.x) should roll over to port 443.

If you can me out, I thank you in advance.

Shawn
  Réponse avec citation
Vieux 03/10/2006, 19h32   #2
lark
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SSL Redirect

lark wrote:
> Hello All,
>
> I do not think that I have a unique situation and/or configuration
> problem but for some reason I can't find anything on this problem out
> there.
>
> Here's the problem:
>
> I have a single apache (1.3) server with an ssl site configured
> correctly on port 443. We have an intranet environment where it is
> acceptable to connect to this apache server on port 80 but this server
> also serves ineternet requests and I want all those requests to
> automatically roll over to port 443.
>
> So for example if the request is coming from an ip address that looks
> like this "10.5.100.200" it may go to port 80 but any other requesting
> ip address (other than starting with 10.x.x.x) should roll over to port
> 443.
>
> If you can me out, I thank you in advance.
>
> Shawn



i put this and it appears is not working:

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^10\. [NC]
RewriteRule ^(.*) https://%{SERVER_NAME}$1 [R,L]

Any thoughts????

thanks in advance.
  Réponse avec citation
Vieux 03/10/2006, 20h03   #3
Jim Hayter
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SSL Redirect

lark wrote:
> lark wrote:
>> Hello All,
>>
>> I do not think that I have a unique situation and/or configuration
>> problem but for some reason I can't find anything on this problem out
>> there.
>>
>> Here's the problem:
>>
>> I have a single apache (1.3) server with an ssl site configured
>> correctly on port 443. We have an intranet environment where it is
>> acceptable to connect to this apache server on port 80 but this server
>> also serves ineternet requests and I want all those requests to
>> automatically roll over to port 443.
>>
>> So for example if the request is coming from an ip address that looks
>> like this "10.5.100.200" it may go to port 80 but any other requesting
>> ip address (other than starting with 10.x.x.x) should roll over to
>> port 443.
>>
>> If you can me out, I thank you in advance.
>>
>> Shawn

>
>
> i put this and it appears is not working:
>
> RewriteEngine On
> RewriteCond %{HTTP_REFERER} !^10\. [NC]
> RewriteRule ^(.*) https://%{SERVER_NAME}$1 [R,L]
>
> Any thoughts????
>
> thanks in advance.


Try using (untested):

RewriteCond %{REMOTE_ADDR} !^10\.
RewriteRule ...

Remember to put this where it will only be invoked if the connection is
not already secure, otherwise you will create a loop.

Jim
  Réponse avec citation
Vieux 03/10/2006, 20h08   #4
lark
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SSL Redirect

Jim Hayter wrote:
> lark wrote:
>> lark wrote:
>>> Hello All,
>>>
>>> I do not think that I have a unique situation and/or configuration
>>> problem but for some reason I can't find anything on this problem out
>>> there.
>>>
>>> Here's the problem:
>>>
>>> I have a single apache (1.3) server with an ssl site configured
>>> correctly on port 443. We have an intranet environment where it is
>>> acceptable to connect to this apache server on port 80 but this
>>> server also serves ineternet requests and I want all those requests
>>> to automatically roll over to port 443.
>>>
>>> So for example if the request is coming from an ip address that looks
>>> like this "10.5.100.200" it may go to port 80 but any other
>>> requesting ip address (other than starting with 10.x.x.x) should roll
>>> over to port 443.
>>>
>>> If you can me out, I thank you in advance.
>>>
>>> Shawn

>>
>>
>> i put this and it appears is not working:
>>
>> RewriteEngine On
>> RewriteCond %{HTTP_REFERER} !^10\. [NC]
>> RewriteRule ^(.*) https://%{SERVER_NAME}$1 [R,L]
>>
>> Any thoughts????
>>
>> thanks in advance.

>
> Try using (untested):
>
> RewriteCond %{REMOTE_ADDR} !^10\.
> RewriteRule ...
>
> Remember to put this where it will only be invoked if the connection is
> not already secure, otherwise you will create a loop.
>
> Jim



Well, there is no effective way for me to know that; so, I was thinking
maybe I can put in another rule such as this:

RewriteRule %{SERVER_PORT} = 80

to make sure it only fires off when and if server port is 80!

What do you think?

If this is possible, which rules should be listed first, i wonder?

thanks
  Réponse avec citation
Vieux 03/10/2006, 20h45   #5
Jim Hayter
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SSL Redirect

lark wrote:
> Jim Hayter wrote:
>> lark wrote:
>>> lark wrote:
>>>> Hello All,
>>>>
>>>> I do not think that I have a unique situation and/or configuration
>>>> problem but for some reason I can't find anything on this problem
>>>> out there.
>>>>
>>>> Here's the problem:
>>>>
>>>> I have a single apache (1.3) server with an ssl site configured
>>>> correctly on port 443. We have an intranet environment where it is
>>>> acceptable to connect to this apache server on port 80 but this
>>>> server also serves ineternet requests and I want all those requests
>>>> to automatically roll over to port 443.
>>>>
>>>> So for example if the request is coming from an ip address that
>>>> looks like this "10.5.100.200" it may go to port 80 but any other
>>>> requesting ip address (other than starting with 10.x.x.x) should
>>>> roll over to port 443.
>>>>
>>>> If you can me out, I thank you in advance.
>>>>
>>>> Shawn
>>>
>>>
>>> i put this and it appears is not working:
>>>
>>> RewriteEngine On
>>> RewriteCond %{HTTP_REFERER} !^10\. [NC]
>>> RewriteRule ^(.*) https://%{SERVER_NAME}$1 [R,L]
>>>
>>> Any thoughts????
>>>
>>> thanks in advance.

>>
>> Try using (untested):
>>
>> RewriteCond %{REMOTE_ADDR} !^10\.
>> RewriteRule ...
>>
>> Remember to put this where it will only be invoked if the connection
>> is not already secure, otherwise you will create a loop.
>>
>> Jim

>
>
> Well, there is no effective way for me to know that; so, I was thinking
> maybe I can put in another rule such as this:
>
> RewriteRule %{SERVER_PORT} = 80
>
> to make sure it only fires off when and if server port is 80!
>
> What do you think?
>
> If this is possible, which rules should be listed first, i wonder?
>
> thanks


That's not a rule. You want to do it as another condition. RewriteCond
are anded by default. Just put multiple RewriteCond statements
preceding your RewriteRule.

Jim
  Réponse avec citation
Vieux 04/10/2006, 01h32   #6
lark
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SSL Redirect

Jim Hayter wrote:
> lark wrote:
>> Jim Hayter wrote:
>>> lark wrote:
>>>> lark wrote:
>>>>> Hello All,
>>>>>
>>>>> I do not think that I have a unique situation and/or configuration
>>>>> problem but for some reason I can't find anything on this problem
>>>>> out there.
>>>>>
>>>>> Here's the problem:
>>>>>
>>>>> I have a single apache (1.3) server with an ssl site configured
>>>>> correctly on port 443. We have an intranet environment where it is
>>>>> acceptable to connect to this apache server on port 80 but this
>>>>> server also serves ineternet requests and I want all those requests
>>>>> to automatically roll over to port 443.
>>>>>
>>>>> So for example if the request is coming from an ip address that
>>>>> looks like this "10.5.100.200" it may go to port 80 but any other
>>>>> requesting ip address (other than starting with 10.x.x.x) should
>>>>> roll over to port 443.
>>>>>
>>>>> If you can me out, I thank you in advance.
>>>>>
>>>>> Shawn
>>>>
>>>>
>>>> i put this and it appears is not working:
>>>>
>>>> RewriteEngine On
>>>> RewriteCond %{HTTP_REFERER} !^10\. [NC]
>>>> RewriteRule ^(.*) https://%{SERVER_NAME}$1 [R,L]
>>>>
>>>> Any thoughts????
>>>>
>>>> thanks in advance.
>>>
>>> Try using (untested):
>>>
>>> RewriteCond %{REMOTE_ADDR} !^10\.
>>> RewriteRule ...
>>>
>>> Remember to put this where it will only be invoked if the connection
>>> is not already secure, otherwise you will create a loop.
>>>
>>> Jim

>>
>>
>> Well, there is no effective way for me to know that; so, I was
>> thinking maybe I can put in another rule such as this:
>>
>> RewriteRule %{SERVER_PORT} = 80
>>
>> to make sure it only fires off when and if server port is 80!
>>
>> What do you think?
>>
>> If this is possible, which rules should be listed first, i wonder?
>>
>> thanks

>
> That's not a rule. You want to do it as another condition. RewriteCond
> are anded by default. Just put multiple RewriteCond statements
> preceding your RewriteRule.
>
> Jim



Good deal! I added the conditions one after the other and the rule right
after them. i'll have to test from home to see how it works. thanks much
for your time.

shawn
  Réponse avec citation
Vieux 04/10/2006, 09h22   #7
rivano@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SSL Redirect


lark ha escrito:

> Hello All,
>
> I do not think that I have a unique situation and/or configuration
> problem but for some reason I can't find anything on this problem out
> there.
>
> Here's the problem:
>
> I have a single apache (1.3) server with an ssl site configured
> correctly on port 443. We have an intranet environment where it is
> acceptable to connect to this apache server on port 80 but this server
> also serves ineternet requests and I want all those requests to
> automatically roll over to port 443.
>
> So for example if the request is coming from an ip address that looks
> like this "10.5.100.200" it may go to port 80 but any other requesting
> ip address (other than starting with 10.x.x.x) should roll over to port 443.
>
> If you can me out, I thank you in advance.
>
> Shawn







RewriteEngine On
RewriteCond %{HTTP_REFERER} !^10\. [NC]
RewriteRule ^(.*) https://%{SERVER_NAME}$1 [R,]


type this....!!!

  Réponse avec citation
Vieux 04/10/2006, 15h09   #8
lark
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SSL Redirect

lark wrote:
> Jim Hayter wrote:
>> lark wrote:
>>> Jim Hayter wrote:
>>>> lark wrote:
>>>>> lark wrote:
>>>>>> Hello All,
>>>>>>
>>>>>> I do not think that I have a unique situation and/or configuration
>>>>>> problem but for some reason I can't find anything on this problem
>>>>>> out there.
>>>>>>
>>>>>> Here's the problem:
>>>>>>
>>>>>> I have a single apache (1.3) server with an ssl site configured
>>>>>> correctly on port 443. We have an intranet environment where it is
>>>>>> acceptable to connect to this apache server on port 80 but this
>>>>>> server also serves ineternet requests and I want all those
>>>>>> requests to automatically roll over to port 443.
>>>>>>
>>>>>> So for example if the request is coming from an ip address that
>>>>>> looks like this "10.5.100.200" it may go to port 80 but any other
>>>>>> requesting ip address (other than starting with 10.x.x.x) should
>>>>>> roll over to port 443.
>>>>>>
>>>>>> If you can me out, I thank you in advance.
>>>>>>
>>>>>> Shawn
>>>>>
>>>>>
>>>>> i put this and it appears is not working:
>>>>>
>>>>> RewriteEngine On
>>>>> RewriteCond %{HTTP_REFERER} !^10\. [NC]
>>>>> RewriteRule ^(.*) https://%{SERVER_NAME}$1 [R,L]
>>>>>
>>>>> Any thoughts????
>>>>>
>>>>> thanks in advance.
>>>>
>>>> Try using (untested):
>>>>
>>>> RewriteCond %{REMOTE_ADDR} !^10\.
>>>> RewriteRule ...
>>>>
>>>> Remember to put this where it will only be invoked if the connection
>>>> is not already secure, otherwise you will create a loop.
>>>>
>>>> Jim
>>>
>>>
>>> Well, there is no effective way for me to know that; so, I was
>>> thinking maybe I can put in another rule such as this:
>>>
>>> RewriteRule %{SERVER_PORT} = 80
>>>
>>> to make sure it only fires off when and if server port is 80!
>>>
>>> What do you think?
>>>
>>> If this is possible, which rules should be listed first, i wonder?
>>>
>>> thanks

>>
>> That's not a rule. You want to do it as another condition.
>> RewriteCond are anded by default. Just put multiple RewriteCond
>> statements preceding your RewriteRule.
>>
>> Jim

>
>
> Good deal! I added the conditions one after the other and the rule right
> after them. i'll have to test from home to see how it works. thanks much
> for your time.
>
> shawn


Jim,
I tested from home and it all worked well. The only thing I had to
change was that I had to take out the equal sign from the SERVER_PORT
condition. It does not need an equal sign. I guess it does the
comparison automatically.

Thanks,
Shawn
  Réponse avec citation
Vieux 04/10/2006, 15h13   #9
lark
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SSL Redirect

rivano@gmail.com wrote:
> lark ha escrito:
>
>> Hello All,
>>
>> I do not think that I have a unique situation and/or configuration
>> problem but for some reason I can't find anything on this problem out
>> there.
>>
>> Here's the problem:
>>
>> I have a single apache (1.3) server with an ssl site configured
>> correctly on port 443. We have an intranet environment where it is
>> acceptable to connect to this apache server on port 80 but this server
>> also serves ineternet requests and I want all those requests to
>> automatically roll over to port 443.
>>
>> So for example if the request is coming from an ip address that looks
>> like this "10.5.100.200" it may go to port 80 but any other requesting
>> ip address (other than starting with 10.x.x.x) should roll over to port 443.
>>
>> If you can me out, I thank you in advance.
>>
>> Shawn

>
>
>
>
>
>
> RewriteEngine On
> RewriteCond %{HTTP_REFERER} !^10\. [NC]
> RewriteRule ^(.*) https://%{SERVER_NAME}$1 [R,]
>
>
> type this....!!!
>


Thanks! I have almost the same thing as you have in here. Mine looks
like this:

RewriteEngine On
RewriteCond %{REMOTE_ADDR} !^10\. [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*) https://%{SERVER_NAME}$1 [R,L]

I added the server port check to make sure it doesn't go in a loop. the
remote address is a better variable because it checks for the ip number.

what does http referer return, ip or the dns name?

thanks
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 10h50.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,20410 seconds with 17 queries