I have a project setup where I have multiple subdomains for different purposes like login.example.com
, signup.example.com
and blog.example.com
. I only have the domain configured but not created any sub-domains. All sub-domains should be loaded from their respective folder on root folder like example.com
is running from root folder files and there are 3 more folders for login
, signup
and blog
.
I have written this code in .htaccess
file to load sub-domain from folder
RewriteEngine on
RewriteCond %{HTTP_HOST} ^login.example.com
RewriteRule ^(.*)$ http://example.com/login/$1 [L,NC,QSA]
But it's not working and giving me a 500 error.
How can I do it?