Home htaccess redirect best way to do it?
Reply: 0

htaccess redirect best way to do it?

R Green
1#
R Green Published in 2017-12-07 01:40:27Z

redirecting to https and non-www to www. I'm using the following. For the last line is it best to use ^ or .* or maybe ^(.*)$ directly after RewriteRule? I see all them used and all work. Just don't know enough which is best. Thank you!

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.298014 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO