Webmaster Forum

Go Back   Webmaster Forum > Web Development > Web Design Lobby

Web Design Lobby Forum for general web design issues not specific to scripting or graphics.

Thread Tools Display Modes
Share |
Old 03-02-2018, 10:21 PM
anandsoft anandsoft is offline
Contributing Member
Join Date: 01-27-07
Posts: 173
iTrader: 0 / 0%
htaccess code for HTTPS Conversion of website

We have recently converted HTTP:// website to HTTPS:// The following code is used within htaccess file for directing all traffice from h??p://domain.com and h??p://www.domain.com to h??ps://www.domain.com. (Replace ?? with tt) Exact code given below:
->>>>>>>>>>>>>>>>>>>>>begin htaccess code-----

Options Indexes FollowSymLinks Includes
Options +FollowSymLinks

RewriteEngine on

RewriteCond %{HTTPS} off
# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.

RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

# Now, rewrite any request to the wrong domain to use www.
# [NC] is a case-insensitive match

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

AddType text/html .shtml
AddHandler server-parsed .html

<<<<<<<<<<<<<<-------------end htaccess code------
Will it be sufficient to divert all traffic from http to https? Will it be okay with Google search engine with respect to rankings? Appreciate any feedback. I would like to add that the code is working okay as far as the displaying the web pages is concerned.

Reply With Quote



Old 03-31-2018, 10:38 AM
localflavourstours localflavourstours is offline
Junior Member
Join Date: 03-30-18
Location: Kolkata, West Bengal, India
Posts: 7
iTrader: 0 / 0%
Use this code:
RewriteEngine On RewriteCond %{HTTPS} !on RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
But it is recommended that avoid redirecting all http requests to https respectively as it may cause you a false impression of security. So you should probably redirect the "root" of your http site to the root of your https site and link from there, only to https
Reply With Quote
Old 03-31-2018, 11:09 AM
itarachiu itarachiu is offline
Contributing Member
Join Date: 03-30-18
Posts: 66
iTrader: 0 / 0%
Lol, yesterday I was looking for the same thing and I found this on stackoverflow, same code lines.
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[FREE] Free malwares\viruses and blacklists website scanning service beng1 The Webmaster Marketplace 3 07-06-2017 04:22 AM

V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory

All times are GMT -7. The time now is 02:37 PM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC