Reputation: 698
I apologize for the stupid question.
I have my website setup where evanstoddard.me/about
ends up being evanstoddard.me/index.php?cmd=about
. This works great for the desktop website but I now want it to work for the mobile site as well.
I have a script setup to detect if the browser is a mobile website so I can just as easily have the desktop site pass that parameter to the mobile site but I now want evanstoddard.me/mobile/about
to run evanstoddard.me/mobile.php?cmd=about
.
Here is my .htaccess file as of now:
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/([^/.]+)/?$ [NC]
RewriteRule . /index.php?cmd=%1 [L]
How would I go about first making evanstoddard.me/mobile
go to evanstoddard.me/mobile.php
and anything like evanstoddard.me/mobile/about
point to evanstoddard.me/mobile.php?cmd=about
?
Thanks for the help in advance!
Upvotes: 1
Views: 111
Reputation: 785156
Have it this way:
RewriteEngine on
RewriteRule ^mobile/?$ /mobile.php [L,NC]
RewriteRule ^mobile/([^/.]+)/?$ /mobile.php?cmd=$1 [L,QSA,NC]
RewriteRule ^([^/.]+)/?$ /index.php?cmd=$1 [L]
Upvotes: 2