httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Walter H." <walte...@mathemainzel.info>
Subject Re: [users@httpd] Issue with redirection from HTTP to HTTPS
Date Wed, 06 Feb 2013 12:52:40 GMT
On Wed, February 6, 2013 07:14, Nikolas Kallis wrote:

> I already thought of 'Redirect / https://nikolaskallis.com/' but don't
> want to use it because if someone enters from
> 'http://nikolaskallis.com', then they should be taken to its HTTPS
> equivalent, which is 'https://nikolaskallis.com' - not
> 'https://nikolaskallis.com/'.
>
> 'Redirect . https://nikolaskallis.com' didn't work for me. I got a 404
> because of the way my server is setup.
>
> I have HTTP and HTTPS data kept in separate folders:
>
> '/var/www/http/nikolaskallis.com/' is for HTTP and contains one file
> only - '.htaccess', which redirects to HTTPS, which is kept in
> '/var/www/https/nikolaskallis.com/'.

then you should have in your .htaccess something like

RewriteEngine  on
RewriteCond    %{HTTPS} !=on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

Greetings,
Walter



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message