【发布时间】:2013-05-01 06:18:52
【问题描述】:
我似乎无法让我的 .htaccess 工作,我正在尝试将所有不是真实文件或文件夹的 url 重写到我的 index.php。我所在的目录是 /cms 重写似乎只在我使用这个 .htaccess 时才起作用
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /cms/index.php [L]
</IfModule>
当我尝试使用 RewriteBase /cms/ 并将最后一行更改为 . /index.php [L] 就像它的意思一样,重写不会重写为 localhost/cms/index.php 而是被重写为 localhost/index.php
【问题讨论】: