直接在浏览器中能访问http://localhost/webmaster/index.html吗??
解决方案 »
- 请问php的重定向函数是什么?
- 关于日期格式判断的正则表达式
- PHP 隐含域 与 数组 问题...高手帮忙~~
- 使用session_set_save_handler函数实现将session保存在数据库中后session不能跨页面了!
- 有人用曼波或者JOOMLA实际做公司或者自己做过项目吗?来说说用过的感受吧
- php能有象javascript里的for( var s in object )的功能吗?能循环类里的属性吗?
- shell 如何调取文件中的数据
- 问题求助 循环读取问题
- 6位QQ靓号免费送,经公证处认证!
- 怎么把一个其它网站的文件拷入本地目录
- 如何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可以正常跳转,
建议同楼上所述配置,可以跳转。
不建议使用相对路径