[BlueOnyx:20948] Re: Force to HTTPS

"Meaulnes Legler"@MailList bluelist at waveweb.ch
Mon Apr 24 07:39:45 -05 2017


On 24.04.17 12:04, Richard Sidlin wrote:
>
> Guys
>
> A basic question if I may. I have a Wordpress site with some other software that is accessed on one of the sub folders. i.e. www.wordpresssite.co.uk <http://www.wordpresssite.co.uk> and www.wordpresssite.co.uk/race-entry <http://www.wordpresssite.co.uk/race-entry> .
>
> Now, I am about to add a LetsEncrypt SSL to the Wordpress site, that’s easy enough but what I want is anyone that types the standard www etc to be forced to https://www etc as I have a Stripe payment facility off the sub folder and that needs to be on https.
>
I did this by editing in /etc/httpd/conf/vhosts/siteXX.include and adding:

       RewriteEngine  On

       RewriteCond    %{SERVER_PORT}  !^443$

       #RewriteRule   ^(.*)$ https://%{HTTP_HOST}/$1   [QSA,NC,R,L]

       RewriteRule    ^(.*)$ https://%{HTTP_HOST}$1    [QSA,NC,R,L]

and restarting afterwards the Apache server.

You might have to try out which one of the two RewriteRules (with or without / before $1 works out better, mine is without.

Best regards

Meaulnes Legler
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~  www.WaveWeb.ch  ~
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~ Zurich, Switzerland ~
~ tel: +41 44 2601660 ~


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.blueonyx.it/pipermail/blueonyx/attachments/20170424/ef64e07e/attachment.html>


More information about the Blueonyx mailing list