After SSL Encryption HTTP TO Https Redirection Issue on Domain

0

Hi there,

My website is on WordPress and after SSL Encryption it open on both protocol http and https, meanwhile, I'm looking to open my website only on HTTPS Protocol.

I've add this code in htacess as well unfortunately it won't work

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

let me know precise solution which can redirect my http to https automatically or permanently

thanks

4 réponses
0
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

You'll need to place the code snippet after the RewriteBase / in the .htaccess file.

profile picture
EXPERT
répondu il y a 9 mois
  • Is there any URL to add here, Secondly, website still open on http as well. please provide the proper solution thanks

  • You have to ensure your placing the config in the correct location on the htaccess

    No url needed.

  • It has to sit in the <IfModule mod_rewrite.c> section

0

Make sure that your SSL certificate is installed and activated correctly. Check the permissions on your .htaccess file. The file should be readable and writable by the web server. Try clearing the browser cache and cookies.

profile pictureAWS
répondu il y a 9 mois
profile pictureAWS
EXPERT
vérifié il y a 9 mois
0

Unfortunately, the website still open in http://buyerassistances.com. I want permanent redirect to https 😑 wrongfully I marked you as accept answer please provide proper code where to add thanks

répondu il y a 9 mois
0
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]

This code will redirect all HTTP traffic to HTTPS. The first line, RewriteEngine On, tells Apache to enable the rewrite engine. The second line, RewriteCond %{SERVER_PORT} 80, checks to see if the request is coming in on port 80, which is the default port for HTTP. If the request is coming in on port 80, the third line, RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L], will redirect the request to the HTTPS version of the site. The [R,L] at the end of the line tells Apache to do a permanent redirect (301).

profile pictureAWS
répondu il y a 9 mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions