【发布时间】:2018-09-17 04:00:33
【问题描述】:
我试图在我尝试使用 .htaccess 文件创建的 codeigniter 中从我的 url 中删除 index.php,但它不起作用。
RewriteEngine on
RewriteBase /
RewriteRule ^(application|system|\.svn) index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
我尝试使用此代码,这些是 mu bse 和站点 url。我对如何正确使用 htaccess 知之甚少。任何帮助都是可观的。
$config['base_url'] = 'http://localhost/xxxx/';
$config['site_url'] = 'http://localhost/xxxx/index.php';
【问题讨论】:
-
只需将
RewriteRule ^(application|system|\.svn) index.php/$1 [L]替换为RewriteRule ^(.*)$ index.php?/$1 [L]
标签: php .htaccess codeigniter