Contact Us: Call Us Icon 01227 656451 Contact Us Icon This email address is being protected from spambots. You need JavaScript enabled to view it.

×
 x 

Cart empty
Shopping cart
Cart empty

htaccess - redirect non-www to www with HTTPS

If you would like to redirect visitors to your web site from the non-www version (e.g. hostingmatters.co.uk) to the www version (www.hostingmatters.co.uk) whilst also redirecting them to the https version of the site, then you can do so using this addition to your htaccess file:

RewriteCond %{HTTPS} !on [OR]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule (.*) https://www.hostingmatters.co.uk%{REQUEST_URI} [L,R=301]

Simply copy and paste these lines to the top of your htaccess file and then replace 'hostingmatters.co.uk' with your web site's own address.

This will redirect visitors trying to go to:

to

https://www.example.com

 

Was this helpful?

About Us

We're a small team who support hundreds of web sites, small and large, across the UK and beyond.

We love, web sites, SEO and helping your business grow.

Read more...

Contact Us

info@hostingmatters.co.uk

For support, please e-mail support@hostingmatters.co.uk use our live chat facility or call us on 01227 656451.

Customer Support

If you have any questions or are having problems, just get in touch.

Use our 'Contact Us' page to e-mail us or talk to us on live chat about any queries that you may have or any support issues.

Short Testimonial

Paul McKinney, customer

"Without a doubt the most professional and outstanding customer service out there. Buy with confidence."