zoukankan      html  css  js  c++  java
  • 开启Apache mod_rewrite模块(解决404 Not Found)

    网站搭建完成了,进入登录界面就是访问不了。

    原因大概是没有开启Apache mod_rewrite模块,或者没有配置完全。

    步骤1:

    启用mod_rewrite模块
    在conf目录的httpd.conf文件中找到

    LoadModule rewrite_module modules/mod_rewrite.so


    将这一行前面的#去掉。

    步骤2:

    <Directory "/var/www/myweb">
    
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
        Options Indexes FollowSymLinks
    
    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
        AllowOverride All
    
    #
    # Controls who can get stuff from this server.
    #
        Order allow,deny
        Allow from all
    
    </Directory>

    步骤3:

    重新启动apache

    service httpd restart

    如此便可以访问了页面了,.htaccess文件在所有的子页面都有效了。

    404Not Found问题解决了。

  • 相关阅读:
    蓝桥杯基础练习题4(16进制转8进制)2
    实验三
    文法
    用文法描述词法规则
    词法分析程序的功能
    个人对于编译原理的一些看法的。
    完成登录与注册
    javaScript基础
    css实例
    导航,头部,CSS基础
  • 原文地址:https://www.cnblogs.com/jiqing9006/p/3277393.html
Copyright © 2011-2022 走看看