【发布时间】:2015-08-30 14:52:05
【问题描述】:
我的 htaccess 和路由文件有问题。我想配置我的 default_controller。
$route['default_controller'] = 'fr/index';
我想使用 URL 重写。使用 htaccess 文件删除我的 URL 中的“index.php”。
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?/page=$1 [QSA]
RewriteCond $1 !^(index.php|assets/|robots.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
当一个工作时,另一个不起作用。
你有没有一个想法来配置我的 htaccess 以删除 'index.php' 并将 default_controller 添加到 routes.php ?
我的控制器位于 application/controllers/subfolder/myControllers.php 的子文件夹中
感谢您的回答。
【问题讨论】:
标签: php apache .htaccess codeigniter mod-rewrite