301 Redirect http to https .htaccess code needed urgently
Hi all,
Ive had a very basic website for a friend on aso for years.
Now I wish to move my own website to a startup business package.
However, this package applies https to every page and all my google links are http, ive been searching for hours to find a pre written code for how to perform a google friendly 301 redirect for the entire http site to https
Can anyone help, ive been to the relevant google websmaster page and apache pages but I just don't understand it all enough.
All I know is that I have to open wordpad, paste the code, save as .htaccess and ftp to server root.
Thanks in advance,
Michael
-
Hello :) Have you considered using the "Redirects" option in cPanel? Or, if you prefer to edit the .htaccess file directly, this post should help: Force use of SSL Thank you. 0 -
Many thanks for your lightning fast reply ! I wish my shopping cart software sellers were the same as you. Are you saying I can do this: Open wordpad create empty file called .htaccess Paste this code: RewriteEngine on RewriteCond %{HTTP_HOST} ^yourwebsite\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.yourwebsite\.com$ RewriteRule ^(.*)$ "https\:\/\/yourwebsite\.com\/$1" [R=301,L] Upload to root directory on aso ? Is that all correct and 100% server friendly Michael [COLOR="silver">- - - Updated - - - Obviously putting my domain in not 'yourwebsite' 0 -
Yes, that is correct. However, note that if your script already uses custom Mod_Rewrite rules you may have to adjust them accordingly. Thank you. 0 -
Many thanks, Does the cpanel redirect option work in the same way and is it as good and google friendly as the htaccess one ? Michael 0 -
Hello, Yes, the cPanel redirect should work just fine and be "Google Friendly". 0 -
Ok thanks, just signed up and in cpanel already. I have a few more questions, will search before posting. Michael 0
Please sign in to leave a comment.
Comments
6 comments