我将index.php从CodeIgniter中的URL中删除。我已经更改了.htaccess文件数据。但是,我想知道是否有其他方法从index.php或任何其他.htaccess数据中删除该URL。意味着这只是一种方法。
在.htaccess文件中,我写了以下内容:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]发布于 2014-05-27 13:32:37
试试这个:
确保已在Apache模块上启用了rewrite_module。
.htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|indexcp\.php?|resources|robots\.txt)
RewriteRule ^([A-Za-z0-9_/.-]+)$ index.php?/welcome/$1开放config.php :-
$config['index_page'] = '';
$config['base_url'] = 'http://www.example.com/'; //your site name
$config['uri_protocol']= 'REQUEST_URI';发布于 2014-05-27 13:29:56
试试下面的代码:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]不要忘记在配置文件中为null索引值。
$config['index_page'] = ''; 发布于 2021-09-15 03:32:23
Options +FollowSymLinks
RewriteEngine on
# Send request via index.php (again, not if its a real file or folder)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
<IfModule mod_php5.c>
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
<IfModule !mod_php5.c>
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>https://stackoverflow.com/questions/23890371
复制相似问题