htaccess and mobile site |
[eluser]Codepeak[/eluser]
Hi! I'm about to develop a mobile version of my CodeIgniter application. For this I've made a new controller called "mobile" that will handle the magic. Visiting "http://domain/mobile/index/iphone" the correct page is shown. But since that URL isn't very nice, I want to spice it up abit. In my .htaccess (before the rewrites that CI does) I've added: Code: RewriteCond %{HTTP_HOST} ^m.domain [NC] But that doesn't do the magic. What I'm trying to achive is to have my visitors visit "http://m.domain/index/iphone". Right now that just gives me a 404. Any tips, tricks or obvious errors that I have made? Tnx Edit: http://m.domain and http://domain is pointing at the same directory on the server. The "m" site works exactly like the main site w/o any problems (except the rewrite problem above).
[eluser]Codepeak[/eluser]
Solved. Code: RewriteCond %{HTTP_HOST} ^m\.domain\.dev
[eluser]drmanny[/eluser]
Hello, Can you share the controller called “mobile”, i am looking to do the same Thanks Manny
[eluser]Codepeak[/eluser]
Hey! The controller is extremly simple... Just a dir called "mobile" in the application/controller/ directory. Example of some files: application/controller/chat.php Handles the chat application/controller/iphone.php Handles iPhone frontpage application/controller/sys.php Handles login/logouts. Etc... m.domain.com/iphone/index is rerouted using the .htaccess above to domain.com/mobile/iphone/index Simple as that :-) |
Welcome Guest, Not a member yet? Register Sign In |