一个关于Apache Rewrite从FPM转到FastCGI的问题

新手上路,请多包涵

目的是想要将PC版http://test.com/front/index这样的Url
在手机版上显示为http://test.com/m/front/index
实际的链接应该是http://test.com/front/index?mode=m

现在我在测试环境上的Rewrite是这么写的:
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^m/?(.*)/?$ index.php/$1/?mode=m [QSA,PT,L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
一切都可以正常访问,而到了服务器上则出现了问题

本地测试环境是XAMPP(据别人说是FPM),服务器上的是Apache FastCGI
想要请教一下应该如何改写Rewrite规则才能正常解析,谢谢?

阅读 3.3k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题