【发布时间】:2016-09-20 02:37:57
【问题描述】:
让,$staging_url = http://xx.xx.xx.xx/
$mobile_url = http://xx.xx.xx.xx/mobile/xxx/testing
我已经在我的htaccess 文件中定义了这个重定向规则:
RewriteCond "%{HTTP_USER_AGENT}" "(android|blackberry|googlebot-mobile|iemobile|ipad|iphone|ipod|opera mobile|palmos|webos)" [NC]
RewriteRule "/(.*)$" "/mobile/xxx/testing/$1" [L]
当我从手机点击 $staging_url 时,它会重定向到 $mobile_url。但是,当我点击 $staging_url/design?id=23 时。它再次重定向到 $mobile_url ,我希望它重定向到 $mobile_url/design?id=23
提前致谢。我使用变量来定义我的链接,因为堆栈溢出只允许低于 10 名声望的用户使用 2 个链接。 我的 .htaccess 文件:
RewriteEngine On
Options FollowSymLinks
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} (facebookexternalhit/[0-9]|Twitterbot|Pinterest|Google.*snippet)
RewriteRule ^(.*)design$ story.php?id=$1 [L,QSA]
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|iphone|ipod|ipad|iemobile" [NC]
RewriteRule ^(.*)$ http://google.com [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{HTTP_USER_AGENT} !facebookexternalhit/[0-9]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /#/$1 [L]
【问题讨论】: