Hello,
I’m redirecting users from mobile device to a mobile version for my website but, I like to prevent a couple of directories to be redirected when acces from a mobile device.
My htaccess code its like this:
# Set the default handler.
DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# 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]
</IfModule>
# END WordPress
#redirect mobile browsers
RewriteCond %{HTTP_USER_AGENT} ^.*iPhone.*$
RewriteRule ^(.*)$ http://m.mywebsite.com/ [R=301]
RewriteCond %{HTTP_USER_AGENT} ^.*BlackBerry.*$
RewriteRule ^(.*)$ http://m.mywebsite.com/ [R=301]
RewriteCond %{HTTP_USER_AGENT} ^.*Palm.*$
RewriteRule ^(.*)$ http://m.mywebsite.com/ [R=301]
I need to prevent the automatic redirect for this 2 directories:
http://www.mywebsite.com/directory-one/
http://www.mywebsite.com/directory-two/
I think, I should use a Cond but don’t have clear how to write the condition.
I hope someone can give me a hand figure it out
Thanks in advance