Forum Moderators: phranque

Message Too Old, No Replies

Port redirection

only want port 443, not 80

         

delboy1978uk

2:26 pm on Sep 14, 2005 (gmt 0)

10+ Year Member



i have set up apache on ssl, so i can type in my computer name with http, and it goes to apache default page through port 80
I can also get to it when i type in https, securely through SSL

I turned off listening to port 80, thinking it would auto-redirect me to the only other port listening, 443, but it didnt

instead all i got was connection refused error message

how can i set this up to forward all port 80 requests to port 443?

jdMorgan

5:09 pm on Sep 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



One method would be to turn port 80 listen back on, and use mod_rewrite to check %{SERVER_PORT} and redirect to port 443 if the request is not addressed to port 443.

Jim

delboy1978uk

12:31 pm on Sep 16, 2005 (gmt 0)

10+ Year Member



sounds awesome, will give it a try

PS u said 'one way to try it'

I take it then that there are others?
I also take it that this is the simplest method

Will let you know how I get on. :-)

delboy1978uk

12:41 pm on Sep 16, 2005 (gmt 0)

10+ Year Member



i just found a page saying all i need to do is alias [localhost...] with [localhost,...] and that it is only a single line of code that is required.

Also that mod_alias is already part of apache so i dont need to download anything.

The question now is....
what is the alias code line? and what conf file does it go into?

jdMorgan

3:48 pm on Sep 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I suspect the procedure would be to define two servers, one listening to 80 and the other to port 443, then use mod_alias' RedirectPermanent directive to redirect all requests for the port 80 server to the port 443 server.

I'm not sure, I've never tried it and I haven't read the mod_ssl documentation.

Jim