繁体   English   中英

用codeigniter删除URL 1and1的index.php

[英]remove index.php of the url 1and1 with codeigniter

嗨,我在通过htaccess 1and1从网址中删除index.php时遇到问题,我尝试了其他线程的多个示例,但均无法正常工作。 如果我在localhost上运行,则htaccess如下:

RewriteEngine on
RewriteCond $1 !^(index\.php|js|css|resources|images|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]

希望能有所帮助。

  1. 检查是否启用了mod_rewrite

  2. config.php删除index.php

     //$config['index_page'] = 'index.php'; //old line $config['index_page'] = ''; // New line 
  3. .htaccess添加以下代码

     RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] 

对于最后一行,请尝试使用

RewriteRule ^(.*)$ /index.php/$1 [L]

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM