0 votes
604 views
asked 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
answered 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
0 answers 318 views
asked Feb 12, 2017 in Laravel by Simply
0 votes
2 answers 8.2k views
0 votes
2 answers 2.2k views
+1 vote
1 answer 6.5k views
+1 vote
1 answer 995 views
...