我的主站点(www.jguffphotography.com)目前被htaccess重定向到(mobile.jguffphotography)。效果很好
我有一个目录分别重定向(www.jguffphotography.com/photopage/)到(Mobe.jguffPhotography.com/photopage)
我有一个htaccess文件在我的主域,并在光刻目录。
所有的工作从我的手机很好,但在个人电脑上的光光网址重定向到移动子域。
我拥有的主要域htaccess编码是
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|googlebot-mobile|iemobile|ipad|iphone|ipod|opera mobile|palmos|webos" [NC]
RewriteRule ^$ http://mobile.jguffphotography.com [L,R=302]
我在光刻目录中找到的是
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|googlebot-mobile|iemobile|ipad|iphone|ipod|opera mobile|palmos|webos" [NC]
RedirectMatch 301 ^/photopage/([^.]+).html$ http://mobile.jguffphotography.com/photopage/$1.html
发布于 2012-07-04 01:00:49
RedirectCond是mod_rewrite的一部分,适用于下面的RewriteRule。RedirectMatch是mod_alias的一部分,与以前的情况没有任何关系。您需要坚持使用mod_rewrite:
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|googlebot-mobile|iemobile|ipad|iphone|ipod|opera mobile|palmos|webos" [NC]
RewriteRule ^photopage/([^.]+).html$ http://mobile.jguffphotography.com/photopage/$1.html [R=301,L]https://stackoverflow.com/questions/11321144
复制相似问题