CodeIgniter - How to hide index.php from the URL

前端 未结 4 959
伪装坚强ぢ
伪装坚强ぢ 2021-01-19 02:09

This is what my .htaccess looks like. The .htaccess is sitting in /www/scripts directory which is the parent of codeigniter\'s s

相关标签:
4条回答
  • 2021-01-19 02:52

    Just toss the following code into your .htaccess file

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

    Source: http://codeigniter.com/user_guide/general/urls.html

    0 讨论(0)
  • 2021-01-19 03:06

    here is the solution simply drop in root.

    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .* index.php/$0 [PT,L] 

    0 讨论(0)
  • 2021-01-19 03:07

    use this:

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /folder/index.php/$1 [L]
    
    0 讨论(0)
  • 2021-01-19 03:15

    CodeIgniter User Guide on URLs

    0 讨论(0)
提交回复
热议问题