0

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]
gex
  • 1
  • 1
  • 4

1 Answers1

2

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.

hek2mgl
  • 152,036
  • 28
  • 249
  • 266
  • hek2mgl can u give me your skype id? – gex Jul 12 '13 at 11:46
  • 1
    Sounds like a request for a larger support session. You'll have to pay for that. But whats wrong with communication here? maybe I can help using the comments here as well - unpaid. This would make the communication open for all. – hek2mgl Jul 12 '13 at 11:49
  • ok so i dont know how to configure DNS that client request for subdomain to sent to my webserver.. please help me? – gex Jul 12 '13 at 11:53
  • Are you on shared hosting? – hek2mgl Jul 12 '13 at 11:53
  • than DNS configuration will be made by them. If creating sud domains is part of your contract then most hosters provide a web gui where you can create sub domains. – hek2mgl Jul 12 '13 at 11:57
  • Problem is here because i use codeigniter framework and i want to make my controller subdomain.. for example: http://example.com/controller => controller.example.com – gex Jul 12 '13 at 12:01
  • The process is fully transparent for the PHP level. You only need to deploy a regular website to the webspace of the sub.domain. However, for me it looks weeeeeirrrd what you are about to do – hek2mgl Jul 12 '13 at 12:04
  • if you can't understand it's maybe a little bit too much for you at the moment. why do you need that? – hek2mgl Jul 12 '13 at 12:08