服务器技术

 首页 > 服务器技术 > WinServer > apache下开启.htaccess 伪静态支持配置方法

apache下开启.htaccess 伪静态支持配置方法

分享到:
【字体:
导读:
         [导读] 1、首先确定Apache是否加载了Mod_rewrite 模块 方法: 检查 httpd.conf 中是否存在以下两段代码 (具体路径可能会有所不同,但形式基本是一样的): (一)LoadModule rewrite_module libexec/mod_rewrite.so (二...

1、首先确定Apache是否加载了Mod_rewrite 模块

方法: 检查 httpd.conf 中是否存在以下两段代码 (具体路径可能会有所不同,但形式基本是一样的):

(一)LoadModule rewrite_module libexec/mod_rewrite.so

(二)AddModule mod_rewrite.c

2、检查Apache是否开启.htaccess支持

httpd.conf

AllowOverride All #如果后面参数为None需要修改为All


编辑apache的httpd.conf

 代码如下 复制代码


    Options FollowSymLinks
    AllowOverride All


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


3、在文件httpd.conf相应的主机目录配置中加入如下代码(此时须注意,如果网站是通过虚拟主机来定义,请务必加到虚拟主机配置中去,否则可能无法使用。)


注意事项:我当时也只把AllowOverride none改成了all但是没有效果,后来直接查了了httpd.conf文件中所有AllowOverride none替换成AllowOverride All再重启apache就可以使用htaccess了。

(责任编辑:mfm8学习中心)
分享到:
win7 xampp安装后apache无法启动怎么办
我开始在网站找了一些办法如下   1 在"网上邻居"上 点右键,菜单上选"属性(R)"。出来"网络连接"窗口,在"本地连接"上点右键,菜单中点"属性(R)"。出来"本地连接 属性"面板,在"此链接使用下列项目"中找到:"Internet 协议 (TCP/IP)",并点击它。在弹出的"Internet 协议 (TCP/IP) 属性"面板上,点击"高级(V)..."按...
PHP开发Apache服务器配置详解
照此配置流程,绝对一路畅通,可保无虞。 昨天弄了个PHP小程序,想在本地跑一下测试,可是工作电脑没有安装环境,于是下载了一个wamp,一路畅通,Apache、Mysql、PHP就全有了。启动wamp服务,在浏览器里输入“http://localhost”,访问正常,跳出wamp首页。于是,下面想把自己的CrashServer网站配置到Apache里,可以通过虚...
  •         php迷,一个php技术的分享社区,专属您自己的技术摘抄本、收藏夹。
  • 在这里……