WebFaction
Community site: login faq

Hi, I want to realize the following: if a user comes to my site, and has a mobile device, I want redirect his browser to a subdomain, that points to one of my site controller. (MVC controller/method) Example: User enter: www.mysite.com

PHP script detects mobile device, redirects him to m.mysite.com

m.mysite.com really points to www.mysite.com/mobile/index

Important would be the url remains m.mysite.com

I'm not sure I really need two applications, I guess I can use one controller serving the mobile device. I tried this htaccess (http://goo.gl/DLTRa) with no success.

Thanks

asked 06 Feb '12, 08:50

sub
124
accept rate: 0%

edited 06 Feb '12, 08:51


Hi,

Perhaps an easier way for you to do this would be to create a "symbollic link" app and link it to the /home/<user>/webapps/<app>/mobile/index directory (replace <user> and <app> with your actual username and webapp name). You can then mount this symbollic link app to the site record for m.mysite.com.

If you experience any further troubles with this, please open a ticket, so we can take a look at your setup.

permanent link

answered 06 Feb '12, 09:15

todork
1.2k5
accept rate: 34%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×76
×5
×4
×1

question asked: 06 Feb '12, 08:50

question was seen: 3,004 times

last updated: 06 Feb '12, 09:15

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2020 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM