首页 >运维 >Apache > 正文

apache如何开启伪静态

原创2019-07-26 09:55:5204393

apache开启伪静态的步骤:

打开apache的配置文件httpd.conf,路径:wamp\bin\apache\apache2.4.9\conf\httpd.conf

找到

 #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 文件

更多Apache的相关技术文章,请访问Apache教程栏目进行学习!

以上就是apache如何开启伪静态的详细内容,更多请关注php中文网其它相关文章!

php中文网最新课程二维码

声明:本文原创发布php中文网,转载请注明出处,感谢您的尊重!如有疑问,请联系admin@php.cn处理

  • 相关标签:apache 伪静态
  • 相关文章

    相关视频


    网友评论

    文明上网理性发言,请遵守 新闻评论服务协议

    我要评论
  • 专题推荐

    作者信息

    步履不停

    分分合合拂袖悲欢,生生世世心甘情愿。

    最近文章
    phpStudy2018 Nginx4045480
    PHP中的进制转换3411
    PHP 代码优化 技巧总结3225
    推荐视频教程
  • Apache Storm教程手册Apache Storm教程手册
  • Apache2.2中文手册Apache2.2中文手册
  • Apache和MySQL安装使用教程Apache和MySQL安装使用教程
  • 视频教程分类