duangan4070 2013-11-20 05:15
浏览 72
已采纳

codeigniter localhost内部服务器错误500

I am starting a new project in codeigniter. While setting up work folder in localhost i put the following htaccess file in my project root folder for remove index.php from the url

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

now i am getting the error message as follows

"Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request."

my project path is localhost/sc

in the config.php file i put the following line

 $config['base_url']='http://localhost/sc';

server error message is " Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration"

I am using wamp server in windows platform please help me to solve this problem

Thank you

  • 写回答

6条回答 默认 最新

  • dty97501 2015-01-13 12:46
    关注

    This .htaccess script works perfectly for me. Place it within the first set of folders inside your project directory. Same level as the index.php file

    RewriteEngine on
    RewriteCond $1 !^(index\.php|public|\.txt) 
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?$1
    

    The error 500 can be checked on the apache error.log file using the following path /var/log/apache2/error.log

    Check the last error listed and fix it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(5条)

报告相同问题?

悬赏问题

  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题