gex
gex

Reputation: 1

How to create a subdomain using htaccess

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

Answers (1)

hek2mgl
hek2mgl

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

Related Questions