I've been trying to find a solution to my situation but none worked. I have the following htaccess file which does the following:
It redirects site.com/m/page to site.com/m/#page
I redirects site.com/d/page to site.com/m/#page
It deletes .php extension and the common_ pattern which I had in front of the pages
The code so far:
Options +FollowSymlinks -MultiViews
RewriteEngine On
RewriteBase /
RewriteRule ^[dm]/(.+)$ /m/#$1 [R=302,NE,L,NC]
## hide .php extension
RewriteCond %{THE_REQUEST} \s/+common_([^.]+)\.php[\s?] [NC]
RewriteRule ^ %1 [R=302,L,NE]
## To internally forward
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}/common_$1.php -f
RewriteRule ^(.+?)/?$ common_$1.php [L]
I would like the folowing:
a) If some user enters from an iPhone 'site.com/m/...' , continue (do nothing)
b) If some user enters from a desktop ar iPad 'site.com/m/page' to redirect him to 'site.com/d/#page'
I would really appreciate some help.