I have a little problem with my .htaccess
. For example, if I go to test.example.com
, it's in folder /sub/test
. But it shows test.example.com/sub/test
. How can I hide the path after .com
? Or is there any way to do it with Apache, like all folders in sub
folder are subdomains?
I don't know how to do it.
I'm using this:
RewriteCond %{HTTP_HOST} ^((?!www\.).+?)\.example\.com$ [NC]
RewriteRule ^((?!sub/).*)$ /sub/%1/$1 [L]
EDIT: I want to make every created folder in sub
folder as a subdomain automatically. Like user create folder and it's subdomain.
.htaccess
file? Any other.htaccess
files? Check the network traffic, presumably you are seeing a 3xx redirect? What type?