Stupid htaccesss question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Damian_Maxcash
    So Fucking Banned
    • Oct 2002
    • 12745

    #1

    Stupid htaccesss question

    I have removed all the pages on a domain

    I put in an htaccess with 404 handling and it works ok

    Unless I go to the root ie. www.domain.com then it goes to the dir listing

    I thought it wouldnt find an index page and then go to the 404

    What am I doing wrong??

    Thanks

    Sorry for the stupid question
  • fusionx
    Confirmed User
    • Nov 2003
    • 4618

    #2
    Originally posted by damian2001
    I have removed all the pages on a domain

    I put in an htaccess with 404 handling and it works ok

    Unless I go to the root ie. www.domain.com then it goes to the dir listing

    I thought it wouldnt find an index page and then go to the 404

    What am I doing wrong??

    Thanks

    Sorry for the stupid question
    It's working as it is supposed to. You are not requesting a document that doesn't exist.

    If you really need to, you can redirect anything hitting domain.com to /index.html, which will then trigger the 404.

    I'm not sure why you would do this.

    Comment

    • Addiction
      Registered User
      • Jan 2005
      • 20

      #3
      Make an index.php with just this line of code in it.

      <?header("Location:http://www.yourdomain.com");?>
      all your traffic are belong to me.

      Comment

      • some_idiot
        Confirmed User
        • May 2002
        • 1511

        #4
        It's doing this because in your httpd.conf you have it set to allow directory
        listings. If you never need directories listed set the global to no. If you do
        need directories, then add a line to the virtual host section for no.

        list root directory = 200 success, not a 404 not found.

        Cheers!

        This AVS pays my mortgage!

        Comment

        • fusionx
          Confirmed User
          • Nov 2003
          • 4618

          #5
          Originally posted by Addiction
          Make an index.php with just this line of code in it.

          <?header("Location:http://www.yourdomain.com");?>
          Very nice loop!

          When it redirects, it will automagically load index.php and send them back to the raw URL.

          Comment

          • Damian_Maxcash
            So Fucking Banned
            • Oct 2002
            • 12745

            #6
            Thanks guys!

            Comment

            • Workshop_Willy
              Confirmed User
              • Oct 2004
              • 452

              #7
              Originally posted by damian2001
              I have removed all the pages on a domain

              I put in an htaccess with 404 handling and it works ok

              Unless I go to the root ie. www.domain.com then it goes to the dir listing

              I thought it wouldnt find an index page and then go to the 404

              What am I doing wrong??

              Thanks

              Sorry for the stupid question
              No such thing as a stupid question. Lots of good answers in here. Here's another one. As I understand it, you don't want anything other than a 404 appearing when someone hits a directory below your server root, correct? If that's the case, simply chmod all of those subdirectories to "700" and copy your 404 page (assuming it's custom and you want people to see something custom) to the 403 page. The http error message will be 403, but the page will be indentical to your 404. No need to muck around with htaccess then.

              Just an option.
              FREE Retouch - get a gratis from the best there is!


              Do the Mess-Around...

              Comment

              Working...