[BlueOnyx:20952] Re: Force to HTTPS

Richard Sidlin richard at sidlin.co.uk
Mon Apr 24 10:08:39 -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://% <https://%25> {HTTP_HOST}/$1   [QSA,NC,R,L]
RewriteRule    ^(.*)$ https://% <https://%25> {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 

 

That's great, thanks very much.

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


More information about the Blueonyx mailing list