How to only run SSL on a certain domain?
Posted by: tqqkhang2006@gmail.com (117.3.70.---)
Date: July 08, 2020 04:29AM

How to only run SSL on a certain domain? I run my website on the domain, but when I run it on localhost it always runs SSL, I don't want SSL on localhost. I want use htaccess. Is there any way to combine <If "%{HTTP_HOST}=="mydomain"> with <IfModule mod_rewrite.c>?



Edited 1 time(s). Last edit at 07/08/2020 09:37AM by tqqkhang2006@gmail.com.

Options: ReplyQuote
Re: How to only run SSL on a certain domain?
Posted by: RiggsFolly (Moderator)
Date: July 08, 2020 11:34AM

Hi

A couple of threads you can look at to see how to do this

[forum.wampserver.com]

[stackoverflow.com]

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: How to only run SSL on a certain domain?
Posted by: tqqkhang2006@gmail.com (117.3.70.---)
Date: July 09, 2020 03:38AM

I don't want to run the following code on my localhost, but it still runs on another domain

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ [%1] [R=301,L]

RewriteCond %{HTTPS} !on
RewriteRule (.*) []%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>

Options: ReplyQuote
Re: How to only run SSL on a certain domain?
Posted by: Otomatic (Moderator)
Date: July 09, 2020 09:40AM

RTFM Apache documentation

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote


Sorry, only registered users may post in this forum.