.htaccess problem detecting and redirecting moble devices.
-
I can’t seem to get my .htaccess to detect mobile devices and redirect to /amp/ version.
`
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]#AMP Rewrite
#RewriteEngine On
#RewriteCond %{REQUEST_URI} !/amp$ [NC]
#RewriteCond %{HTTP_USER_AGENT} (android|blackberry|googlebot\-mobile|iemobile|iphone|ipod|\#opera\ mobile|palmos|webos) [NC]
#RewriteRule ^([a-zA-Z0-9-]+)([\/]*)$ https://www.example.com/$1/amp/ [L,R=302]
</IfModule>
# END WordPress
`
- The topic ‘.htaccess problem detecting and redirecting moble devices.’ is closed to new replies.