脚本宝典收集整理的这篇文章主要介绍了php – htaccess中主机名的重定向规则,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
$mobile_url = http://xx.xx.xx.xx/mobile/xxx/testing
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
提前致谢.我使用变量来定义我的链接,因为堆栈溢出只允许2个链接用于少于10个信誉的用户.
我的.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]
以上是脚本宝典为你收集整理的php – htaccess中主机名的重定向规则全部内容,希望文章能够帮你解决php – htaccess中主机名的重定向规则所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。