【发布时间】:2017-05-16 13:54:02
【问题描述】:
当我在浏览器中运行 CI 项目时,使用 localhost/hr,它会将我重定向到 localhost/dashboard/。
搜索了不同的解决方案,但没有得到它的工作。这是我在“htdocs/hr”文件夹中的 .htaccess 文件
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
注意:htdocs文件夹中没有.htaccess文件。
当我删除/重命名 index.php 文件并访问 htdocs 时,它给了我错误。
Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
我做错了什么,如何让它工作?
我的 htdocs/hr 文件夹的屏幕截图如下所示
【问题讨论】:
-
你的 route.php 中有什么
-
$route['default_controller'] = "site"; $route['404_override'] = ''; -
在
RewriteEngine On之后放RewriteBase /hr/
标签: php apache .htaccess codeigniter url-rewriting