分享好友 系统运维首页 频道列表

WampServer设置apache伪静态出现404 not found及You don't have permission to access / on this server解决方法分析

服务器其它  2015-10-29 18:180

本文实例讲述了WampServer设置apache伪静态出现404 not found及You don't have permission to access / on this server解决方法。分享给大家供大家参考。具体如下:

出现404 not found 时:

确保LoadModule rewrite_module modules/mod_rewrite.so开启
然后

复制代码 代码如下:
<Directory />
    Options FollowSymLinks
    AllowOverride none  #此处把none 改成All
    Order allow,deny
    deny from all
</Directory>

 
出现:You don't have permission to access / on this server
复制代码 代码如下:
<Directory />
    Options FollowSymLinks
    AllowOverride none  #此处把none 改成All
    Order allow,deny
    deny from all  #此处把deny改成Allow
</Directory>

 
确保设置了默认首页:
复制代码 代码如下:
<IfModule dir_module>
DirectoryIndex index.html index.htm index.php
</IfModule>

有时候在WampServer上设置Apache伪静态还是会出现
You don't have permission to access / on this server
的提示

这时候进一步修改:

复制代码 代码如下:
<Directory />
    Options FollowSymLinks #此处将FollowSymLinks改为All
    AllowOverride All
    Order allow,deny
    deny from Allow
</Directory>

将Options FollowSymLinks改为:Options All

问题即可解决。

附(伪静态测试代码):

新建php页面index.php:

<php
 if($_GET){
 echo $_GET["id"];
 }
>

同级目录下建立文件.htaccess,写入伪静态规则如下:

复制代码 代码如下:
RewriteEngine On
RewriteRule ^t_(.*).html$ index.phpid=$1

URL地址栏写入:

http://localhost/t_aaa.html

伪静态设置成功则输出:aaa

希望本文所述对大家的Apache服务器设置有所帮助。

查看更多关于【服务器其它】的文章

展开全文
相关推荐
反对 0
举报 0
评论 0
图文资讯
热门推荐
优选好物
更多热点专题
更多推荐文章
windows支持apache、mysql、php集成环境推荐wampserver3.2 64位版本
对英文不感冒的同学很容易下载到更新包,而且官方的下载速度很慢,此文件为官方原版下载,现在分享给大家。链接:https://pan.baidu.com/s/1LYyJi6FddvkQQNrLp4L6Ww 提取码:edsaMD5: 4C32136656EB25E2951E1539D264339ESHA1: 15EAC178B27EE5298883DC3BA351B81

0评论2023-02-10547

wampserver apache 500 Internal Server Error解决办法
Internal Server ErrorThe server encountered an internal error or misconfiguration and was unable to complete your request.Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything

0评论2023-02-09537

WampServer下如何配置多域名
这篇文章主要介绍了WampServer下如何配置多域名的相关资料,需要的朋友可以参考下

0评论2015-10-19142

Wampserver2.5配置虚拟主机出现403Forbidden的处理方案
WampServer是一款由法国人开发的Apache Web服务器、PHP解释器以 及MySQL数据库的整合软件包。免去了开发人员将时间花费在繁琐的配置环境过程,从而腾出更多精力去做开发。在windows下将Apache+PHP+Mysql 集成环境,拥有简单的图形和菜单安装和配置环境。

0评论2015-07-06126

Apache2.4.x版wampserver本地php服务器如何让外网访问及启用.htaccess
这篇文章主要介绍了Apache2.4.x版wampserver本地php服务器如何让外网访问及启用.htaccess,需要的朋友可以参考下

0评论2015-06-29133

WAMPserver配置方法(允许外部访问、phpmyadmin设置为输入用户名密码才可登录等)
这篇文章主要介绍了WAMPserver配置(允许外部访问、phpmyadmin设置为输入用户名密码才可登录等),需要的朋友可以参考下

0评论2015-06-2988

更多推荐