How can you redirect ALL 404 pages on a server to a single php file?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Myst
    Confirmed User
    • Feb 2004
    • 4708

    #1

    How can you redirect ALL 404 pages on a server to a single php file?

    That means on all domains and all subdomains?

    Everything redirected to a single php script..
    ICQ: 298-523-037
  • WiredGuy
    Pounding Googlebot
    • Aug 2002
    • 34515

    #2
    Can't apache pickup all 404 error codes and forward it to your php script page?
    WG
    I play with Google.

    Comment

    • k0nr4d
      Confirmed User
      • Aug 2006
      • 9231

      #3
      httpd.conf
      Mechanical Bunny Media
      Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development

      Comment

      • Myst
        Confirmed User
        • Feb 2004
        • 4708

        #4
        Originally posted by k0nr4d
        httpd.conf
        ooh how?
        ICQ: 298-523-037

        Comment

        • Myst
          Confirmed User
          • Feb 2004
          • 4708

          #5
          also.. can you pass the requested URL to the php script?
          ICQ: 298-523-037

          Comment

          • ffmihai
            keep walking...
            • Jun 2002
            • 7177

            #6
            you add the htaccess file in the vhosts directory

            Comment

            • BucksMania
              Confirmed User
              • Oct 2005
              • 3758

              #7
              add this to a .htacess file and place it as high as possible in the dir structure

              ErrorDocument 404 http://domain.com/yourscript.php

              Comment

              • grumpy
                Too lazy to set a custom title
                • Jan 2002
                • 9870

                #8
                Originally posted by BucksMania
                add this to a .htacess file and place it as high as possible in the dir structure

                ErrorDocument 404 http://domain.com/yourscript.php
                setting the script like that will loose the referal url, instead do it like thise

                ErrorDocument 404 /yourscript.php


                and put the script in the main dir
                Don't let greediness blur your vision | You gotta let some shit slide
                icq - 441-456-888

                Comment

                • bigalownz
                  Confirmed User
                  • Aug 2005
                  • 1657

                  #9
                  or try


                  RedirectMatch 301 (.*)\.shtml$ http://domain.com/404.php
                  RedirectMatch 301 (.*)\.html$ http://domain.com/404.php
                  RedirectMatch 301 (.*)\.htm$ http://domain.com/404.php
                  RedirectMatch 301 (.*)\.php$ http://domain.com/404.php
                  $100 free credit for all hosting needs

                  Comment

                  • Well Dunn
                    Confirmed User
                    • Sep 2005
                    • 1026

                    #10
                    pretty sure you can just edit it in cpanel or httaccess
                    ICQ: 471859252

                    Mailers! ICQ me I want your traffic!!!!

                    We will pay daily, weekly, monthly, WHATEVER! Just contact me and we will get you paid!

                    Comment

                    • ssp
                      Confirmed User
                      • Jan 2005
                      • 7990

                      #11
                      Man such alot of clueless people in this thread..

                      Comment

                      • Broda
                        Confirmed User
                        • Feb 2003
                        • 1874

                        #12
                        Originally posted by ssp
                        Man such alot of clueless people in this thread..
                        agreed!
                        CheapAssDesigns.com - when you need quality designs at affordable prices.
                        icq: 230-729-205
                        info |at| cheap ass designs dot com

                        Comment

                        Working...