.htaccess overide all subdomain folder
Hello,
I have main domain (DOMAIN.LTD) root directory at /home/user/public_html/
and sub domain (SUB.DOMAIN.LTD) root directory at /home/user/public_html/sub.domain.ltd/
and from WHM, i force it to use public_html as document root.
at the main domain, i have .htaccess like bellow:
this htaccess will force to use and will make auto SSL fail to obtain certificate for
Options -Indexes
RewriteEngine On
RewriteBase /
# First rewrite to HTTPS:
# Dont put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Now, rewrite any request to the wrong domain to use www.
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
this htaccess will force to use and will make auto SSL fail to obtain certificate for
-
Hello, You will need to edit your custom Mod_Rewrite rules to ensure they do not apply to your subdomain. You may find the following URLs helpful: mod_rewrite - Apache HTTP Server Version 2.4 How to stop sub directory inheriting parent's htaccess rules How to prevent .htaccess inheritance? SSL wildcard use with subdomains Excluding a subdomain from .htaccess mod_rewrite rules? Thank you. 0 -
Thank you, i will try for that 0 -
Hello, You will need to edit your custom Mod_Rewrite rules to ensure they do not apply to your subdomain. You may find the following URLs helpful: mod_rewrite - Apache HTTP Server Version 2.4 How to stop sub directory inheriting parent's htaccess rules How to prevent .htaccess inheritance? SSL wildcard use with subdomains Excluding a subdomain from .htaccess mod_rewrite rules? Thank you.
can you give me sample costum Mod_Rewrite rules from my case? Thank You0 -
Hello, I've moved this thread to our Workarounds and Optimization forum to allow for user-feedback on custom Mod_Rewrite rules. You may also want to post to a forum such as StackOverflow for specific advice on custom rewrite rules. Thanks! 0 -
Hello, I've moved this thread to our Workarounds and Optimization forum to allow for user-feedback on custom Mod_Rewrite rules. You may also want to post to a forum such as StackOverflow for specific advice on custom rewrite rules. Thanks!
or if not posible hope cpanel can give ability to edit main directory root path, since i think it will good if all web data in public_html with it's own webroot path0 -
or if not posible hope cpanel can give ability to edit main directory root path, since i think it will good if all web data in public_html with it's own webroot path
Instructions on changing the document root for primary domain name associated with an account are found at: Changing DocumentRoot of all sites Thank you.0
Please sign in to leave a comment.
Comments
6 comments