douyan1613 2014-07-01 07:04
浏览 48

500内部服务器错误CodeIgniter htaccess mod_rewrite

I coded my web application on windows, and I am pushing it to my server, which runs Ubuntu Linux. Here is my .htaccess file:

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /SearchDatGifUbuntu/
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
  # If we don't have mod_rewrite installed, all 404's
  # can be sent to index.php, and everything works as normal.
  ErrorDocument 404 /index.php
</IfModule>

My file at /etc/apache2/sites-available/default is as follows:

<Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>

I typed sudo a2enmod rewrite into the command line on my ubuntu server, and it says mod_rewrite is already turned on.

As I debugged through my codeigniter application, the error seemed to show up on line 308 in CodeIgniter.php, which is:

$CI = new $class();

Can someone please let me know what is going on?

  • 写回答

3条回答 默认 最新

  • doujie7886 2014-07-01 12:14
    关注
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]  
    

    Try this .htaccess code, and restart your apache

    If this does not work please try this link

    How to enable mod_rewrite for Apache 2.2

    评论

报告相同问题?