直接在浏览器中能访问http://localhost/webmaster/index.html吗??
解决方案 »
- 这段JS代码在火狐中为什么不管用
- php 连接 sybase 问题
- 纯真Ip数据库的解析函数怎么到了我的PHP力就没法用了?
- session_destroy和session_unset的区别
- plite框架-MVC模式的超轻量级框架
- 寻找项目伙伴,需要一名PHP核心技术伙伴
- 请教一下关于数组的问题--搞不定啦!
- 怎么加密我的PHP源码?
- 帮忙看看我写的class的构造函数那错?
- 怎么让这个搞成一个二维数组,js控制,jquery,都可以,提交到后台,后台去解析这个二维数组??急
- 如何Spreadsheet_Excel_Writer 将 xls 数据导入到 mysql
- 如何用非js方法得到option选项的值?
但客户端浏览器上的地址是不会变也,也就是说不是重定向的
小弟刚接触PHP不久 帮帮忙了
当客户端访问不到内容的时间,会把这个index.html的内容返回给客户端,但客户端上的URL看上去还是那个错误的地址如果你要让客户端看到的地址,也自动转变为http://localhost/webmaster/index.html
你可以将配置改成ErrorDocument 404 /nopage.php
nopage.php的内容为:
<?php
header("Location:/webmaster/index.html");
?>
httpd.conf里面 ErrorDocument 404 /nopage.php
然后在建了D:\server\xampp\htdocs\nopage.php
然后PHP文件中
<?php
header("Location:/webmaster/index.html");
?>
重启apache 输入 http://localhost/webmaster/sdfsdfsdf.html 还是跳不到指定的 http://localhost/webmaster/index.html 这个页面 还是报错的404错误页面 还请大哥帮下忙, 小弟菜!!
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 http://localhost/webmaster/index.htmlErrorDocument 404 /nopage.php #ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html
#我这么写的 不能写在这里?
但是httpd.conf 确找不到他在哪里设置了
DocumentRoot "/home/httpd/html"
missing.html 所在目录:
/home/httpd/html可以正常跳转,
建议同楼上所述配置,可以跳转。
不建议使用相对路径