[wp-hackers] Re: Mobile version using a plugin

Jacob Santos wordpress at santosj.name
Sat Jan 26 04:05:01 GMT 2008


Chetan Kunte wrote:
> Minor correction in the code (updated below, but not working):
>
> <?php
>
> if ( !strstr( $_SERVER['HTTP_HOST'], 'm.' ) )
> return;
>
> header('HTTP/1.1 301 Moved Permanently');
> header('Location: http://www.google.com/reader/m/view/feed/http://' .
> substr($_SERVER['HTTP_HOST'], 2) . 'feed/atom');
> exit();
>
> ?>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>   

if ( !strstr( $_SERVER['HTTP_HOST'], 'm.' ) )
return;

header('HTTP/1.1 301 Moved Permanently');
header('Location: http://www.google.com/reader/m/view/feed/http://' .
trailingslashit(substr($_SERVER['HTTP_HOST'], 2)) . 'feed/atom');
exit();


See if that works.



-- 

Jacob Santos

http://www.santosj.name - blog
http://funcdoc.wordpress.com - WordPress Documentation Blog/Guide Licensed under GPLv2

Also known as darkdragon and santosj on WP trac.



More information about the wp-hackers mailing list