【发布时间】:2013-08-18 11:01:44
【问题描述】:
我是 htacces 的新手.. 我有这样的文件htaccess
Options -Indexes
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
我在没有 index.php 的情况下这样调用 url,它可以工作
http://localhost/url/
但是当我尝试打电话时
http://localhost/url/controller/
和
http://localhost/url/controller/method/
返回 xampp 主页的页面。
那我该怎么办?我想要没有 index.php 的 url。
非常感谢您的每一个建议。
【问题讨论】:
-
它不起作用,我得到 404 Page Not Found The page you request was not found.
-
您还有其他 htaccess 文件吗?具体来说,“控制器”目录中有没有?
-
您的站点在
url文件夹下还是根目录下? -
请看我的回答stackoverflow.com/a/18230894/1613335,也许对你有帮助
-
不,我只有一个 htaccess 文件。
标签: .htaccess codeigniter mod-rewrite