I am currently creating multiple subdomain handeling system. I don'know how to set the .htaccess
until I found this tutorial at Youtube.
I followed the original source code:
RewriteEngine on RewriteCond %{HTTP_HOST} !^www.your_domain.com RewriteCond %{HTTP_HOST} ^([^.]+).your_domain.com RewriteRule ^$ /index.php?name=%1 [L]
And I modify it to:
RewriteEngine on RewriteCond %{HTTP_HOST} !^www.mlaxproject.com RewriteCond %{HTTP_HOST} ^([^.]+).mlaxproject.com RewriteRule ^$ /sub_website/%1
It is almost completed; the URL takes me to the correct directory, but the only problem is that it reveals the sub directory at my URL:
expect result : demos.mlaxproject.com
show result :demos.mlaxproject.com/sub_website/demos/
How I would like it to be:
demos.mlaxproject.com
test.mlaxproject.com
hello.mlaxproject.com
And not:
demos.mlaxproject.com/sub_website/demos/
test.mlaxproject.com/sub_website/test/
hello.mlaxproject.com/sub_website/hello/
which is what I am getting,
Thanks and sorry for my English.