dpfqy5976 2014-12-29 08:02 采纳率: 100%
浏览 24

托管基于php mvc的网站时出现500内部服务器错误

I am trying to host a site for a first time and having problem while hosting the php MVC based site, 500 internal server error is shown.

While I tried before in localhost (using wampserver) the same error occured but I managed to solve it by uncommenting the 'LoadModule rewrite_module modules/mod_rewrite.so' statement in httpd.conf

But in cpanel there is no option to configure httpd.conf. I googled the problem but couldn't reach to the solution. Also I found out the httpd.conf is the global configuration and we don't have permission to access the file. So is there any way to solve 500 error through .htaccess configuration?

Options -MultiViews
RewriteEngine On

RewriteBase /mysitename.com

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
  • 写回答

1条回答 默认 最新

  • douza19870617 2014-12-29 08:08
    关注

    You may create a .htaccess file in the root of the application directory and add these directives inside it.

    This works as a per-site settings. Whatever you put in httpd.conf is global.

    评论

报告相同问题?