404 .htaccess question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ray@TastyDollars
    • May 2002
    • 6797

    #1

    404 .htaccess question

    Can you have different 404 .htaccess files in different folders of the same domain? Or will that send the server into a loop?

    Ray
  • adultseo
    Confirmed User
    • Jun 2005
    • 365

    #2
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^/*.*$ http://www.yourdomain.com/404.php?file=%{REQUEST_FILENAME}$1 \
    [T=application/x-httpd-php,L]

    it enables you to create dynamic 404 pages

    Best Regards,
    Adult SEO
    The key to get ranked one in Google is to provide the best.

    Comment

    • Ray@TastyDollars
      • May 2002
      • 6797

      #3
      Originally posted by adultseo
      RewriteEngine on
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule ^/*.*$ http://www.yourdomain.com/404.php?file=%{REQUEST_FILENAME}$1 \
      [T=application/x-httpd-php,L]

      it enables you to create dynamic 404 pages

      Best Regards,
      Adult SEO
      I'll have to show my "guy" this tomorrow. I have no idea what to do with that..hehe.

      Ray

      Comment

      • swedguy
        Confirmed User
        • Jan 2002
        • 7981

        #4
        ErrorDocument 404 /another404.html

        Just add it to a .htaccess and stick it in the folder you want a different 404 on.
        Last edited by swedguy; 06-15-2005, 04:12 PM.

        Comment

        • Ray@TastyDollars
          • May 2002
          • 6797

          #5
          Originally posted by swedguy
          Just stick a different .htaccess in the folder you want a different 404 on.
          Thats what I was asking. So that IS doable? I thought it would send the server into a never ending loop of death.

          Ray

          Comment

          • swedguy
            Confirmed User
            • Jan 2002
            • 7981

            #6
            Originally posted by Ray
            Thats what I was asking. So that IS doable? I thought it would send the server into a never ending loop of death.

            Ray
            I do it, so it is doable.

            Comment

            • Ray@TastyDollars
              • May 2002
              • 6797

              #7
              Originally posted by swedguy
              I do it, so it is doable.
              thx! testing it now

              Comment

              • fireorange
                Confirmed User
                • Jan 2005
                • 1648

                #8
                Originally posted by adultseo
                RewriteEngine on
                RewriteCond %{REQUEST_FILENAME} !-d
                RewriteCond %{REQUEST_FILENAME} !-f
                RewriteRule ^/*.*$ http://www.yourdomain.com/404.php?file=%{REQUEST_FILENAME}$1 \
                [T=application/x-httpd-php,L]

                it enables you to create dynamic 404 pages

                Best Regards,
                Adult SEO
                Aaah sweeet, thanks hoe

                Comment

                • Ray@TastyDollars
                  • May 2002
                  • 6797

                  #9
                  Originally posted by swedguy
                  I do it, so it is doable.
                  Cool, thx man! Just wanted to make sure it was cool do do before I tried it. Just did a couple of tests and It works fine.

                  Ray

                  Comment

                  • BigRod
                    Confirmed User
                    • Apr 2005
                    • 3685

                    #10
                    Nice info guys !
                    Rod Macdonald
                    Mainstream Ad Agency Owner
                    ICQ: 607306

                    Comment

                    • prime
                      Confirmed User
                      • Feb 2005
                      • 400

                      #11
                      too much .htaccess on a domain slows down a server. creating dynamic 404 pages here is worth a try

                      | offshore solutions | manual labor | staff leasing | and more!
                      Dedicated -Motivated-Managed Employees
                      icq.: 309570461 live chat

                      Comment

                      • Robx
                        Confirmed User
                        • Nov 2004
                        • 357

                        #12
                        Ray, hopefully this will help out a bit on top of the answer you've already received.

                        Apache (the web serving program) reads the httpd.conf file. The httpd.conf file holds all of the settings that the program needs to run.

                        Each .htaccess file builds on the httpd.conf file. Each .htaccess file is in the same format and can even have the same options as found in the httpd.conf file. A good way to think of .htaccess files is that they build on the .htaccess file.

                        As mentioned above, think if you had a whole bunch of .htaccess files in different directories. That would take a long time and a lot of work for Apache to phrase and remember. It's not a big deal on small sites.

                        However, on large sites, it's definatly not a good idea. First, it does slow the whole server down. Also, it becomes a sysadmin nightmare if you need to make a change to more then a couple .htaccess files. The best solution really depends on what you're doing with all the .htaccess files. Maybe Mod_Rewrite is the best solution, or maybe it's just a matter of optimizing your httpd.conf file.

                        Fell free to drop me an ICQ or give me a call in the office.

                        Contact Us About Getting Your Paysites Exposed To Millions Of People On The Peer To Peer Networks!
                        ICQ 124-249-781

                        Comment

                        • pornpf69
                          Too lazy to set a custom title
                          • Jun 2004
                          • 15782

                          #13
                          some very helpful info on this thread....

                          Comment

                          Working...