|
|
|
|
||||||
| alt.apache.configuration Apache web server configuration issues. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 (permalink) |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#2 (permalink) |
|
Messages: n/a
Hébergeur: |
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. |
|
|
|
#3 (permalink) |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#4 (permalink) |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#5 (permalink) |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#6 (permalink) |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#7 (permalink) |
|
Messages: n/a
Hébergeur: |
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....!!! |
|
|
|
#8 (permalink) |
|
Messages: n/a
Hébergeur: |
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 |
|
![]() |
| Outils de la discussion | |
|
|