RewriteRule creating 500 Internal Server Error

后端 未结 4 2186
盖世英雄少女心
盖世英雄少女心 2020-12-07 01:03

I have the following in my .htaccess file:

Options +FollowSymLinks
RewriteEngine on
RewriteRule ^directory/(.*)$ directory/index.php?id=$1

4条回答
  •  [愿得一人]
    2020-12-07 02:08

    If you are using CodeIgniter and is in error problems 500. Follow the solution.

    So to delete the segment "index.php" of URLs in CodeIgniter, you need to do 2 things. The first is to edit the /system/application/config/config.php file, changing the value of index_page policy to empty:

    $config['index_page'] = '';
    

    The second step is to create a file .htaccess

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

    And that's it! From now on, the URLs of your site/system made with CodeIgniter will no longer have the thread (called "annoying" by some) "index.php".

提交回复
热议问题