0

你好,我到处都试过了,我有一个部分解决方案:(

我有这种网址

http://www.somesite.com/about?koje=gore

原文是

http://www.somesite.com/index.php/drey/about?koje=gore

添加了 .htaccess

<IfModule mod_rewrite.c>
# Turn on URL rewriting
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

并删除了 index.php

添加

$route['default_controller'] = "drey";
$route["about"] = 'drey/about'; 

并删除控制器,现在我有问题我想获得这种链接

http://www.somesite.com/gore.html

是否可以在 routes.php 中做到这一点?

4

1 回答 1

0

您需要进入config.php并编写

$config['url_suffix'] = '.html';

您需要记住,为了让您拥有 .html 后缀,您需要使用 CI URL 帮助程序创建链接。CodeIgniter URLsURL Helper中的更多信息

于 2013-06-10T23:18:01.353 回答