I have 3 domains, www.1.com (primany), 2.com (addon)and 3.com (addon) hosted at cPanel (Linux) in single account.
I’m planning to redirect only 1.com to https and not to disturb on other 2 domains, but as i add these codes at .htaccess root, all my other domains get redirected to https://1.com as well.
How do i ensure, only 1.com get redirected to https, without getting all other domain directed to https://1.com/
code that i added
RewriteOptions inherit
RewriteEngine on
AddHandler application/x-httpd-php56 .php56 .php
RewriteCond %{HTTPS} !=on [NC]
RewriteCond %{REQUEST_URI} !^/[0-9]+..+.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/.well-known/pki-validation/[A-F0-9]{32}.txt(?: Comodo DCV)?$
RewriteRule ^(.*)$ https://1.com/$1 [R=301,L]
2
Answers
Managed to figure out, i've edited the .htaccess at root directory by add these at top:
Using
1.php
as the name of the PHP file you want redirected you can write an if condition to check if1.php
was called or some other file.