Reputation: 1
I am having issues with trying to redirect my website permanently. When I am saying I have issues I mean I haven't got a clue how to redirect my website from http://www.example.com to https://example.com.
I understand html and editing the htaccess file. Can anyone advise how to create a complex redirect like above?
Appreciate any the help.
Upvotes: 0
Views: 105
Reputation: 75
If you are using WordPress, then I would recommend you to go with a plugin which will be easy too. Install and Activate the Really Simple SSL plugin from Plugins > Add New. The plugin is specially designed for SSL related issues. Now, you have activated the plugin, it's time to configure settings. First of all, you'll see a floating information box on your WordPress admin dashboard. A button will say: Go Ahead, Activate SSL, just click that button and your site will be SSL ready (not fully yet).
Don't panic if the button not appears. You will need to Go to the plugin's settings and you will find the option there.
What you need is a valid SSL Certificate.
Then go to Settings > SSL, and then Settings from the above navigation menu beside Configuration. There you will see an option saying Enable WordPress 301 Redirection to SSL, put it on. Done!
Now, your site will redirect you and your visitors to the HTTPS verison. That's it.
Tip: If you want to redirect the visitors to HTTPS version without a need of the plugin, then follow below steps.
There are two methods to do so. In the Really Simple SSL plugin, in the settings, you will see an option saying Deactivate Plugin and keep SSL. This will do the work for you by disabling itself and not removing the redirect code from .htaccess and wp-config file.
Another method is a little bit complicated but will redirect the whole website to SSL version. Put the given code in the .htaccess file of your website which you can find in your website's root folder by enabling hidden files (access via FTP client or cPanel File Manager or WordPress plugin):
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]
I hope the above method worked good for you. If you find any difficulty in any process then kindly respond to this answer.
Upvotes: 1