产品服务AMH 免费服务器主机面板SSL证书 免费SSL证书申请 担保单 免费安全、零费率交易平台编程助手免费智能写代码、翻译AMYSQL 免费MySQL管理工具

AMH 社区首页

 AMH社区 - 开放自由有价值的社区

[求助帖] apache-2.4.9 配置Rewrite规则错误

63menhu
铁牌会员
9.89 价值分

63menhu 发表于 2015-05-02 12:48:00
本帖最后由 63menhu 于 2015-5-2 13:19 编辑



apache规则错误,请指教怎么改
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /mobile
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^mobile\/(.*)$ mobile/index.php?$1 [QSA,L]
RewriteBase /admin
RewriteRule ^admin\/(.*)$ admin/$1 [QSA,L]
RewriteBase /attachs
RewriteRule ^attachs\/(.*)$ attachs/$1 [QSA,L]
RewriteBase /themes
RewriteRule ^themes\/.*\.(html|xml) [F,L]
RewriteRule ^themes\/(.*)$ themes/$1 [QSA,L]
RewriteBase /static
RewriteRule ^static\/(.*)$ static/$1 [QSA,L]
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php$2 [QSA,L]
</IfModule>
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>

2015-05-02 12:48:00 1

iCharlesC
银牌会员
2462.08 价值分

前面两组 <IfModule mod_rewrite.c> 重复了吧。

试试

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /mobile
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^mobile\/(.*)$ mobile/index.php?$1 [QSA,L]
RewriteBase /admin
RewriteRule ^admin\/(.*)$ admin/$1 [QSA,L]
RewriteBase /attachs
RewriteRule ^attachs\/(.*)$ attachs/$1 [QSA,L]
RewriteBase /themes
RewriteRule ^themes\/.*\.(html|xml) [F,L]
RewriteRule ^themes\/(.*)$ themes/$1 [QSA,L]
RewriteBase /static
RewriteRule ^static\/(.*)$ static/$1 [QSA,L]

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php$2 [QSA,L]
</IfModule>
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
  支持 (0分)  反对 (-1.11分)
回复  2015-05-02 22:22:36 2
 1  (总1页)
AMH社区列表
用户服务中心