网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 休闲娱乐 > 闲话灌水
User Name
Password
 
FAQ Members List Calendar Cheap Glasses

闲话灌水 追逐时尚话题,共度开心时刻,体会生活点滴,分享精彩人生。

Reply
 
Thread Tools Display Modes
  #1   IP: 153.99.31.192
Old 2016-11-17, 06:37 PM
Umpire Umpire is offline
初级会员
 
Join Date: 2009-11-11
Posts: 2
Umpire 现在声名狼藉
Default How do I Force my Website to use SSL?

Forcing a specific domain to use HTTPS

To force a specific domain to use HTTPS, use the following lines of code in the .htaccess file in your website's root folder:

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

In the .htaccess code above, if abcd.com website is accessed, it will re-direct to https://xyz.com You will need to replace abcd\.com with the domain name you're forcing to https and also replace www.xyz.com with the domain name to where the website traffic will be re-directed. Here's an example:

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

In the example above, any one typing in http://test-site.com will automatically be re-directed to https://some-website.com.
Forcing all website traffic to use HTTPS

In order to force all web traffic to use HTTPS, use the following code in your .htaccess file. If you are hosting multiple websites on your account, it is possible to have an .htaccess file for each website. Make sure that you are editing the .htaccess file that is in the root folder where you want the re-direct to occur.

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

Be sure to replace www.yourdomain.com with your actual domain name.
Forcing SSL on a specific folder

If you want to force SSL on a specific folder you can insert the code below into a .htaccess file placed in that specific folder:

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

Make sure you change the folder reference to the actual folder name. Then be sure to replace www.yourdomain.com/folder with your actual domain name and folder you want to force the SSL on.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 2 (0 members and 2 guests)
 

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 Off
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How To Force Https On Your X-Cart Admin And X-Cart Provider Sections Tenakee Springs X-Cart 0 2015-03-31 12:58 AM
PayPal 支付模块简介 Website Payments Standard/Pro/Express Checkout yahoo 电子商务 0 2009-10-21 12:07 PM
101 ways to get more traffic sunshine Google Adsense 0 2007-05-09 08:29 PM
Website especially for adsene indianboy Google Adsense 1 2006-04-05 01:08 AM
Comprehensive List of SEO Tools topvip 搜索引擎市场营销研究 0 2006-03-23 01:16 AM

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 07:16 AM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.