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]

  • 相关阅读:
    雅虎天气API调用
    HttpOperater
    HttpOperater-模拟HTTP操作类
    页面局部加载,适合Ajax Loading场景(Demo整理)
    FTPHelper-封装FTP的相关操作
    使用SOCKET实现TCP/IP协议的通讯
    IIS目录禁止执行权限
    Oracle10g 安装步骤
    SQL Server 2008、SQL Server 2008R2 自动备份数据库
    SQL列转行
  • 原文地址:https://www.cnblogs.com/ribavnu/p/4288796.html
Copyright © 2011-2022 走看看