0 votes
4.0k views
in General by
I see lots of suggestions on the web for forwarding http to https. But many of those seems to have a negetive impact on SEO with 302 redirects to homepage. I can force all pages to be viewed through the SSL - that's no problem.  But for SEO reasons, do I need to do a 301 redirect line of code for every page in the site to the new "https" version?  Or is there a way to change everything in a couple of lines looking good at google eyes please?

1 Answer

0 votes
by
Try this for a complete site wide redirect to HTTPS://     

RewriteEngine On    

RewriteCond %{HTTPS} off    

RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]    

All older pages should be caught under this rule.     

Also remember to update your Search Console profiles, sitemap etc

Update any hard-coded links or blocking rules you might have in your robots.txt that might still be pointing to HTTP directories or files.

Related questions

0 votes
1 answer 846 views
0 votes
0 answers 1.0k views
asked Feb 13, 2017 in Laravel by Simply
0 votes
2 answers 12.1k views
0 votes
2 answers 1.9k views
0 votes
1 answer 1.0k views
0 votes
1 answer 1.2k views
...