比如说
wp.jx163.com 是正常显示如果说wp.jx163.com/123123123123.html 这样输入的话就会说 不存在我想让这些不存在的  都指向 主页wp.jx163.com    不知道怎么弄  大家帮帮忙

解决方案 »

  1.   

    如果是windows+IIS我就知道
    如果是apache,不知道有没有页面不存在时显示自己指定的页面的配置没有
      

  2.   

    apache 里有个conf/httpd.conf  这个文件.
      里面有
        #ErrorDocument 404 /missing.html  这个参数的设置  我不确定是不是在这里改````    因为这个是要上服务器改的 所以我不敢乱试`````
      

  3.   

    apache有一个module_rewrite模块
    利用这个模块的功能,加一条rewrite规则就可以了,比如:这条规则就是把所有类似
    wp.jx163.com/123123123123.html 的URL都指向wp.jx163.com/index.htmlRewriteRule ^(.*).html$ index.html
      

  4.   

    那你试下下面的代码ErrorDocument 404 http://wp.jx163.com/
      

  5.   

    回楼上的大哥们,小弟在
    #ErrorDocument 500 "The server made a boo boo."
    #ErrorDocument 404 http://wp.jx163.com/
    #ErrorDocument 404 "/cgi-bin/missing_handler.pl"
    #ErrorDocument 402 http://www.example.com/subscription_info.html
    #
    404改成了 这个url 但是 我本地测试 随便打个url 还是跳不到 指定的URL啊    
      

  6.   

    大哥 去掉了呀#
    # The mod_mime_magic module allows the server to use various hints from the
    # contents of the file itself to determine its type.  The MIMEMagicFile
    # directive tells the module where the hint definitions are located.
    #
    #MIMEMagicFile conf/magic#
    # Customizable error responses come in three flavors:
    # 1) plain text 2) local redirects 3) external redirects
    #
    # Some examples:
    ErrorDocument 500 "The server made a boo boo."
    ErrorDocument 404 http://wp.jx163.com
    ErrorDocument 404 "/cgi-bin/missing_handler.pl"
    ErrorDocument 402 http://www.example.com/subscription_info.html
    ##
    # EnableMMAP and EnableSendfile: On systems that support it, 
    # memory-mapping or the sendfile syscall is used to deliver
    # files.  This usually improves server performance, but must
    # be turned off when serving from networked-mounted 
    # filesystems or if support for these functions is otherwise
    # broken on your system.
    #
    EnableMMAP off
    EnableSendfile off
      

  7.   

    另,用RewriteRule确实有点误导——因为5楼的写法太简单粗暴了。
      

  8.   

    重启apache后 还是显示不到指向的URL啊 apache\conf\httpd.conf 里面加  ErrorDocument 404 http://www.sohu.com 大家帮帮忙啊
      

  9.   

    小弟在 
    apache\conf\httpd.conf 里面加   ErrorDocument 404 /error.html 然后再根目录htdocs下 建了一个 error.html页面    在IE中随便输入个 http://localhost/error111111.html  还是跳转不到那个错误页面 请问问题出在哪里了   帮帮忙吧。。急啊 ~~~~~~~~# Some examples:
    #ErrorDocument 500 "The server made a boo boo."
    ErrorDocument 404 /error.html
    #ErrorDocument 404 "/cgi-bin/missing_handler.pl"
    #ErrorDocument 402 http://www.example.com/subscription_info.html
    #