目的是想要将pc版http://test.com/front/index这样的url
在手机版上显示为http://test.com/m/front/index
实际的链接应该是http://test.com/front/index?mode=m
现在我在测试环境上的Rewrite是这么写的:
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]
一切都可以正常访问,而到了服务器上则出现了问题
本地测试环境是XAMPP(据别人说是FPM),服务器上的是Apache FastCGI
想要请教一下应该如何改写Rewrite规则才能正常解析,谢谢?
目的是想要将pc版http://test.com/front/index这样的url
在手机版上显示为http://test.com/m/front/index
实际的链接应该是http://test.com/front/index?mode=m
现在我在测试环境上的Rewrite是这么写的:
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]
一切都可以正常访问,而到了服务器上则出现了问题
本地测试环境是XAMPP(据别人说是FPM),服务器上的是Apache FastCGI
想要请教一下应该如何改写Rewrite规则才能正常解析,谢谢?
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号