2012-04-18 5 views
2

電話機から、website.comにアクセスしようとすると、mobile.website.comにリダイレクトされます。ただし、mobile.website.comwebsite.comにAJAXリクエストを行いますので、すべてのリクエストはwebsite.com/m/...になります。これは動作していない:htaccess RewriteCondはwebsite/m/...のリクエストをそのままにします。

# redirect phones/tablets to mobile site 
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC] 
RewriteCond %{HTTP_HOST} !mobile\.website\.com [NC] 
RewriteCond %{REQUEST_URI} !^/m/ [NC] 
RewriteRule ^(.*)$ http://www.mobile.website.com/$1 [L,R=302] 

具体行:URLがwebsite.com/m/...と一致した場合に

RewriteCond %{REQUEST_URI} !^/m/ [NC] 

それは書き換えルールをキャンセルしなければなりません。何か案は?

ありがとうございます!これはまだ、あなたのApacheのaccess.logerror.logからマッチした行を投稿してください動作しない場合も

# redirect phones/tablets to mobile site 
RewriteCond %{HTTP_USER_AGENT} (android|blackberry|ipad|iphone|ipod|iemobile|opera [NC]mobile|palmos|webos|googlebot-mobile) [NC] 
RewriteCond %{HTTP_HOST} !mobile\.website\.com$ [NC] 
RewriteRule ^(?!m/).*$ http://www.mobile.website.com%{REQUEST_URI} [L,R,NC] 

答えて

1
はこれで、あなたのコードを変更

関連する問題