0

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?

MrWhite
  • 12,647
  • 4
  • 29
  • 41
Vikram
  • 167
  • 2
  • 10
  • 2
    A 500 error is the webservers way of saying "I have a major problem, but I don't want to talk about it in public". Look at the error log of the server, there will be a clear message saying what's wrong. – Gerald Schneider Oct 26 '17 at 12:09
  • Those directives shouldn't be giving a 500 error, unless perhaps mod_rewrite is not enabled on your server? – MrWhite Oct 26 '17 at 16:34

0 Answers0