【发布时间】:2016-05-02 18:18:42
【问题描述】:
我想更改网址 mysite.com/page?id=s3q4afas 到 mysite.com/page/s3q4afas 与 htaccess。
到目前为止我所拥有的:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$1 [PT,L]
RewriteBase /
RewriteCond %{QUERY_STRING} ^id=([^&]*) [NC]
RewriteRule ^ %{REQUEST_URI}page/%1 [R,L]
</IfModule>
有人可以帮帮我吗?
【问题讨论】:
-
你跳过了the URL section of the docs。你不需要为此惹恼
.htaccess! 默认情况下,CodeIgniter 中禁用查询字符串。只需确保 CodeIgniter 的enable_query_strings配置选项设置为FALSE。
标签: .htaccess codeigniter codeigniter-3