Http to Https redirection

  • Answered
I used this article mention code for my site, but it's not working fine for me, I have to fixed few problems,
1) Always need to search engine links like this " " with https and www.
2) My site have separate mobile site using AMP, When I add article mention .htaccess codes mobile site not working, Need to link like this " "

My codes are below
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\-test\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example\$1 [R,L]

RewriteCond %{HTTP_HOST} ^www\.example\-test\.com$
RewriteRule ^index\.html$ "https\:\/\/www\.example\-test\.com\/" [R=301,L]

Thank you for your question regarding https redirection. If you are using a CMS (such as WordPress, Joomla, Drupal, etc.), I recommend using a plugin or extension to handle redirects. This is because they also rely on .htaccess rules and adding them directly can cause issues.

Also, review your mobile redirect rules (to "") to ensure they are not interfering with the new rewrites you are adding.

Thank you,