zoukankan      html  css  js  c++  java
  • 伪静态设置

    【解决一】设置apache伪静态出现404 not found及You don't have permission to access / on this server解决方法。
    【解决二】APACHE支持.htaccess以及 No input file specified解决方案
    -【404 not found及You don't have permission to access / on this server解决方法】----------
    
    确保LoadModule rewrite_module modules/mod_rewrite.so开启
    
    Options FollowSymLinks
    AllowOverride none  #此处把none 改成All
    Order allow,deny
    deny from all
    
    出现:You don't have permission to access / on this server
    
    Options FollowSymLinks  #此处将FollowSymLinks改为All
    AllowOverride none  #此处把none 改成All
    Order allow,deny
    deny from all  #此处把deny改成Allow
    
    【APACHE支持.htaccess以及 No input file specified解决方案】-
    在你的Apache安装文件夹conf里找到httpd.conf文件
    
    搜索LoadModule rewrite_module modules/mod_rewrite.so 如果前面有注释符号#,请去掉。
    搜索Options FollowSymLinks,然后将它下面的AllowOverride None 修改为AllowOverride All;
    
    没想到遇见了 No input file specified 因为项目用了URL route ,估摸着可能是rewrite的问题。
    
    记录一下解决方案。
    1.检查doc_root 是否设置此值
    2.检查.hta文件 , 很多框架都是index.PHP当入口文件。
    默认的
    RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
    规则在apache fastcgi模式下会导致No input file specified.
    修改成
    RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
    
    启用REWRITE的伪静态功能访问内页就提示:“No input file specified.”,所使用的PHP是fast_cgi模式,而在某些情况下,不能正确识别path_info所造成的错误,.htaccess里面的规则:
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]
    
    而提示是说:“No input file specified.”,也就是说没有得到有效的文件路径.
    RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1] 
    在正则结果“$1”前面多加了一个“?”号,问题也就随之解决了。
    
    在config.inc.php 中加入 define("__TYPECHO_DEBUG__",true); 看出错信息
    cgi.fix_pathinfo
    遇到错误,首先第一个需要做的事情,就是打开typecho的调试模式。在index.php最开始加入如下代码:
    
    file: index.php
    define('__TYPECHO_DEBUG__',true);//add by https://www.typechodev.com
    然后再次访问,出现
    

      

  • 相关阅读:
    linux安装memcache及memcache扩展
    jsop
    用户权限集中管理方案
    linux系统优化配置
    APICloud
    laravel中使用mgirations创建和迁移数据库
    无限分类
    laravel中的验证及利用uploadify上传图片
    Laravel框架数据库CURD操作、连贯操作使用方法
    php 将二维数组批量插入到数据库中
  • 原文地址:https://www.cnblogs.com/fuhuo/p/11290828.html
Copyright © 2011-2022 走看看