Archived

This topic is now archived and is closed to further replies.

  • 0

URL Redirection to mobile Website

Question

Posted · Report post

Hi,

 

I'm using the iBlog Pro Theme and want to redirect smartphone devices to a mobile website instead of the responsive design. I'm using the following code in the htaccess and have the problem that the redirection doesn't work. 

 

RewriteCond %{REQUEST_URI} !^/mobile/.*$
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
RewriteRule ^(.*)$ /mobile/ [L,R=302]

 

Is there a possibility to deactivate the responsive design or give the htaccess redirect a higher priority than the responsive design?

Share this post


Link to post
Share on other sites

7 answers to this question

Posted · Report post

Hi,

 

htaccess is supported by the server, e.g. for permalinks it works without any problems. And I also had a mobile redirection plugin aktivated that works, but only for the homepage. For subpages it always ends with a redirection loop, that's why I want to have a solution with htaccess. The plugin Rob posted is not working in any way.

Share this post


Link to post
Share on other sites

Posted · Report post

Try this:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
RewriteRule ^$ /mobile/ [L,R=302]
</IfModule>

Share this post


Link to post
Share on other sites

Posted · Report post

If you disable PageLines Framework and enable Twenty Ten, Eleven or Twelve, does the same issue apply, where it works on your homepage but not other pages, can you confirm this please.

Share this post


Link to post
Share on other sites

Posted · Report post

Hi,

 

I've tried the htaccess rule yesterday but there is no effect on the redirect.

 

I also tried the plugin above and a few others. No redirection plugin seems to work with iBlog Pro. It looks like if the responsive layout will overrule all the redirection stuff.

 

Can you help me with that problem?

Share this post


Link to post
Share on other sites

Posted · Report post

Hi Zerious,

 

Simon is our senior developer and incredibly knowledgeable with .htaccess.  I'm unsure how he'd resolve this issue, but I'd recommend you consider hiring a pro for this from http://www.pagelines.com/pros.

 

I will alert Simon to this topic.

Share this post


Link to post
Share on other sites

Posted · Report post

.htaccess and url redirection is handled by your server configuration.

 

If redirection is not working at all then you need to contact your host and tell them the apache module rewrite is either not installed or configure incorrectly.

Share this post


Link to post
Share on other sites