WampServer设置apache伪静态出现404 not found及You don't have permission to access / on this server解决方法分析 原创
(福利推荐:你还在原价购买阿里云服务器?现在阿里云0.8折限时抢购活动来啦!4核8G企业云服务器仅2998元/3年,立即抢购>>>:9i0i.cn/aliyun)
本文实例讲述了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开启
然后
Options FollowSymLinks
AllowOverride none #此处把none 改成All
Order allow,deny
deny from all
</Directory>
出现:You don't have permission to access / on this server
Options FollowSymLinks
AllowOverride none #此处把none 改成All
Order allow,deny
deny from all #此处把deny改成Allow
</Directory>
确保设置了默认首页:
DirectoryIndex index.html index.htm index.php
</IfModule>
有时候在WampServer上设置Apache伪静态还是会出现
You don't have permission to access / on this server
的提示
这时候进一步修改:
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,写入伪静态规则如下:
RewriteRule ^t_(.*).html$ index.php?id=$1
URL地址栏写入:
http://localhost/t_aaa.html
伪静态设置成功则输出:aaa
希望本文所述对大家的Apache服务器设置有所帮助。
- 详解CentOS7安装配置Apache HTTP Server
- apache You don''t have permission to access /test.php on this server解决方法
- Apache2.4.x版wampserver本地php服务器如何让外网访问及启用.htaccess
- Win2003+apache+PHP+SqlServer2008 配置生产环境
- Ubuntu Server 10.04修改Apache的默认目录的方法
- Apache中启用Server Status配置示例
- Moon_LServer Linux下一键搭建Apache+PHP+MySQL+Zend+PHPMyAdmin+GD库的软件
- Apache实现Web Server负载均衡详解(不考虑Session版)
- WampServer下安装多个版本的PHP、mysql、apache图文教程
- Linux下Apache HTTP Server 2.4.26安装教程
相关文章
Visual Studio Code 使用Git进行版本控制(图文教程)
这篇文章主要介绍了Visual Studio Code 使用Git进行版本控制(图文教程),小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧2017-11-11URL Rewrite Module 2.1 URL重写模块规则写法
URL重写模块是IIS的扩展,可作为独立IIS Server的下载下载,并且还预先安装在Windows Azure网站(WAWS)上的任何网站上,供您使用,本教程将指导您完成如何为URL重写模块创建和测试一组重写规则2020-12-12
最新评论