Re: Issue with redirection from HTTP to HTTPS

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

 



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@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux