Re: how do i redirect web trafic from port 80 to 443

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 12:17 1/5/2004, you wrote:
> After a long search and lots of trial and error, I managed to get the
> following to work reliably for me:
>
>      RewriteEngine  on
>      RewriteCond    %{SERVER_PORT}  !^443$
>      RewriteRule    ^/(.*)          https://%{SERVER_NAME}/$1 [L,R,NC]
>
to use some configuration you do not understand is never ever
recommended and even might be dangerous.

Perhaps I should have been more specific; however, while I don't understand the [L,R] so far I do understand the rest:


        1. Turn on the rewrite engine.

        2. If the HTTP variable SERVER_PORT is not equal to 443, then:

3. Take any URL that starts with a slash (that is, all URL's supplied) and memorize (.*) everything after the initial slash. Then rewrite the URL as "https://SERVERNAME/$1 where $1 represents the part previously memorized by the (.*).

So any page requested will be redirected to the same URL but with HTTPS instead of HTTP. The NC means "no case" so matches will be case-insensitive.


-- Rodolfo J. Paiz rpaiz@xxxxxxxxxxxxxx http://www.simpaticus.com




[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux