I am looking at updating my htaccess file to control a subdomain being created. I am having issues with a few things.
Firstly I am setting up the domain where http://m.domain.com/ and that is directing to http://www.domain.com/mobile.php/mobile
I would like it work work like this because I don't want to go through a large process of restructuring the URL routing that is currently setup, and fixing it like this would make it much easier.
I would also like this to work locally on my development machine. So the URL below also works: http://local.m.domain.com and the local site redirects to http://local.domain.com/mobile.php/mobile
This means that if I pass parameters after, say :: http://m.domain.com/page it would then route to the page http://www.domain.com/mobile.php/mobile/page
So far I have, but this is just downloading a php file instead of routing any pages.
RewriteCond %{HTTP_HOST} (^local\.|^)m\.domain\.com\.au$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ mobile.php\/mobile$1 [QSA]
I know that the regex for the local or 'nothing' selector is lazy, but I do not think that is what is killing it. Of course I could be wrong.
Any tips or suggestions would be gratefully accepted.