I recently registered a domain name kbcsurveyors.com. Then, I created two sub-domains, which created two new folders in the root folder.
My motive is that if I type kbcsurveyors.com/preinspection, it should point to preinspection.kbcsurveyors.com. Same for other sub domains.
In my .htaccess, which I placed inside root of mydomainname.com, I have written following lines:
RewriteEngine On
RewriteBase /
RewriteRule ^preinspection/(.*)$ https://kbcsurveyors.com/$1 [L,NC,QSA] # Handle requests for "Preinspection"
But this file structure does not work.
How do I write the .htaccess file to achieve what I want?
Regards
Remove or comment out your existing rule.
Create a new file
preinspection/.htaccess
with this rule: