• Welcome to Web Hosting Community Forum for Webmasters - Web hosting Forum.
 

Recommended Providers

Fully Managed WordPress Hosting
lc_banner_leadgen_3
Fully Managed WordPress Hosting

WordPress Theme

Divi WordPress Theme
WPZOOM

Forum Membership

Forum Membership

Error while adding redirect (301) rule on Cpanel to force ssl

Started by Chris, October 31, 2019, 11:50:08 AM

Chris

I am new to server and cpanel. I have successfully purchased and installed ssl certificate on my domain. Now when I try to add redirect (301) for http to HTTPS for all traffic under cpanel its giving error " The is error in Apache rule while processing your request".

Kailash

Try redirecting using .htaccess rewrite rule:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]

Dewlance

If you are using Wordpress or any other CMS software then in URL use https:// instead of http:// or SSL plugin.
Get Premium Web Hosting from Dewlance

dream_webhosts

To set the redirection from HTTP to HTTPS use below code under .htaccess file

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

kumkum

Hi everyone,
I know this is old post and you have also post right thing about redirection to https.
I just want to add that you can also redirect from http to https from cpanel:
- Login to cpanel
- Under domain section click on "Force HTTPS Redirect"
- From this you can redirect your website from http to https without adding code in .htaccess file.

According to me this is the easiest way for the https redirection.