`
用手踢球
  • 浏览: 8817 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

Apache开启伪静态

    博客分类:
  • php
阅读更多
Apache开启伪静态
#LoadModule rewrite_module modules/mod_rewrite.so
把前面#去掉。没有则添加,但必选独占一行,使apache支持 mod_rewrite 模块

找到
<Directory "D:/ApacheServer/web">
    #
    # 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 None

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all

</Directory>

AllowOverride None 换成 AllowOverride All 使apache支持 .htaccess 文件

重启apache服务器

在要启用伪静态的 PHP 项目根目录下建立 .htaccess 文件
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics