zoukankan      html  css  js  c++  java
  • Apache开启伪静态后报500错误.

    参考:http://blog.163.com/lgh_2002/blog/static/44017526201051452939761/

    加载Rewrite模块:

    在conf目录下httpd.conf中找到

    LoadModule rewrite_module modules/mod_rewrite.so

    这句,去掉前边的注释符号“#”,或添加这句。

    允许在任何目录 或者特定目录中使用“.htaccess”文件,将“AllowOverride”改成“All”(默认为“None”)

    <Directory "F:www">  

        AllowOverride All  

    </Directory>

    在Windows系统下不能直接建立“.htaccess”文件,可以在命令行下使用“echo a> .htaccess”建立,然后使用记事本编辑。

    Apache开启伪静态后报500错误.

     检查APACHE日志发现如下信息:

    Request exceeded the limit of 10 internal redirects due to probable configuration error. Use ‘LimitInternalRecursion’ to increase the limit if necessary. Use ‘LogLevel debug’ to get a backtrace.

    从逻辑上说不应该出现内部重定向超限,因为我一共才打开了1个链接。怀疑是rewrite模块规则写错了,进入死循环。突然想起了.htaccess文件, 原来这个站点是测试部署在一个子目录/XXXX下,而.htaccess是直接从另一个网站拷贝过来的
    RewriteEngine On
    RewriteBase  /kohana/
    RewriteRule ^(application|modules|system) - [F,L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .*     index.php/$0 [PT,L] 

    解决方法:将红色部分代码改成如下

    RewriteRule ^(.*)$    /index.php/$1 [PT,L]

  • 相关阅读:
    C#循环语句练习(三)
    C#循环语句练习(二)
    C#的循环语句(一)
    switch case
    C#的选择语句
    C#的选择语句练习(二)
    C#的选择语句练习(一)
    2015.10.30
    16.缓存(Cache)
    15.禁用ViewState
  • 原文地址:https://www.cnblogs.com/ribavnu/p/4288796.html
Copyright © 2011-2022 走看看