(原创)使用apache最经常遭遇的错误:Internal Server Error

今天做生成静态页中的伪静态,要配置.htaccess,遭遇到一个错误,好在没有退缩,一直把它拿下,下面是如何去找错误.
#.htaccess===
RewriteEngine on
RewriteRule ^index\.html$ index.php [L]
        一,出现错误

         把.htaccess配置好,放到WEB根目录下,设置好了一条首页规则.然后用localhost/index.html访问网页时,出现了错误提示:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.

二,跟踪错误
然后去 Apache\logs\error.log里面去找相关错误的详细提示:
.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
说明.htaccess中定义的RewriteEngine根本就没有起作用,问题肯定就是处在httpd.conf 这个配置文件里面了。
三,解决错误
加载rewrite模块,在httpd.conf文件里最后加上如下代码:
LoadModule rewrite_module modules/mod_rewrite.so
也可以直接去掉LoadModule rewrite_module modules/mod_rewrite.so前的注释“#”
本文原文:http://www.pcpph.com/news_c.php?news_id=420100602033610

你可能感兴趣的:(职场,休闲,pcpph)