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.2.0 32bit & 64bit)
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.19>

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

------------------------------------------------------------------------------------------------------------
Wampserver 3.2.3 32 bit - Apache 2.4.46 - PHP 7.4.9…5.6.40 - MySQL 5.7.31 - MariaDB 10.5.5
Wampserver 3.2.3 64 bit - Apache 2.4.46 - PHP 7.4.9…5.6.40 - MySQL 5.7.31/8.0.21 - MariaDB 10.5.5
PhPMyadmin 5.0.2 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote


Sorry, only registered users may post in this forum.