Reputation: 1
I need to create a subdomain mobile.example.com that this subdomain to open through directory "mobile" example.com/mobile.
I try to use so:
RewriteCond %{HTTP_HOST} ^(www\.)?mobile\.example\.com$
RewriteCond %{REQUEST_URI} !^/mobile
RewriteRule ^(.*)$ /mobile/$1 [L]
Upvotes: 0
Views: 334
Reputation: 157927
Creating a subdomain using htaccess is impossible. it's a DNS issue. You'll have to configure DNS in a way that client requests for this sub domain will be send to your web server.
Upvotes: 2