【发布时间】:2011-11-28 01:33:37
【问题描述】:
我在使用 CI 开发的一个应用程序时遇到了严重问题。 目前我的网址如下所示
http://www.example.com/content/index/mission/
我想从 URL 中删除 /content/index/ 所以,它应该看起来像这样。
http://www.example.com/mission
我也有路由和 .htaccess 方法。但似乎没有任何效果。
这是我的 .htaccess 文件
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteCond $1 !^(index\.php|images|css/js/style/system/feature_tab/robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [QSA,L]
我也尝试通过在 config/router.php 中定义路由器来路由 CI,但它不起作用:(
【问题讨论】:
-
确保您已启用
mod_rewrite并在 apache 配置中将AllowOverride设置为All。 (假设你在routes.php中正确创建了路由)
标签: php .htaccess url codeigniter