Htaccess code to redirect folders root with no index ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Doctor Dre
    Too lazy to set a custom title
    • Jan 2001
    • 51692

    #1

    Htaccess code to redirect folders root with no index ?

    Right now It just appears as an empty folder... i wanna redirect it to the main page... tried to google it but can't find it.
    Originally posted by rayadp05
    I rebooted, deleted temp files, history, cookies and everything...still cannot view the news clip. All I see is that fucking gay ass music video from "Rick Roll". Anyone else have a different link to the news clip?
  • Webby
    Too lazy to set a custom title
    • Oct 2002
    • 14956

    #2
    Not sure if this is what you want....


    Redirect /emptydirectory/ http://yoursite.com/whatever.htm

    Mmmm.. not sure about the slash after emptydirectory - may have to drop that
    XXX TLD's - Another mosquito to swat.

    Comment

    • Doctor Dre
      Too lazy to set a custom title
      • Jan 2001
      • 51692

      #3
      It's not the empty directories I want to refresh, but the ones that are full but have no index page. I want it done automacly (not folder by folder). I have thousands of them on the site...

      I accidently re-wrote htaccess
      Originally posted by rayadp05
      I rebooted, deleted temp files, history, cookies and everything...still cannot view the news clip. All I see is that fucking gay ass music video from "Rick Roll". Anyone else have a different link to the news clip?

      Comment

      • DamageX
        Marketing & Strategy
        • Jun 2001
        • 14293

        #4
        Put this in your .htaccess:
        Code:
        DirectoryIndex main.html, index.html, index,shtml, index.php
        This redefines the order in which it looks for your index pages. If you leave it only to main.html (assuming that's the name of your main page, if not rename as fit), then it will look for it in all further subdirectories. Thus the need to add more pages to the list.
        Whitehat is for chumps

        If you don't do it, somebody else will - true story!

        Comment

        • Webby
          Too lazy to set a custom title
          • Oct 2002
          • 14956

          #5
          Again.. not sure

          DirectoryIndex whatever.htm

          ie.. where there is no default index and you want to address a main page as the default index?
          XXX TLD's - Another mosquito to swat.

          Comment

          • Webby
            Too lazy to set a custom title
            • Oct 2002
            • 14956

            #6
            Originally posted by DamageX
            Put this in your .htaccess:
            Code:
            DirectoryIndex main.html, index.html, index,shtml, index.php
            This redefines the order in which it looks for your index pages. If you leave it only to main.html (assuming that's the name of your main page, if not rename as fit), then it will look for it in all further subdirectories. Thus the need to add more pages to the list.
            Gittin there!
            XXX TLD's - Another mosquito to swat.

            Comment

            • Doctor Dre
              Too lazy to set a custom title
              • Jan 2001
              • 51692

              #7
              Originally posted by DamageX
              Put this in your .htaccess:
              Code:
              DirectoryIndex main.html, index.html, index,shtml, index.php
              This redefines the order in which it looks for your index pages. If you leave it only to main.html (assuming that's the name of your main page, if not rename as fit), then it will look for it in all further subdirectories. Thus the need to add more pages to the list.
              Thanks for your time but what I want to do is :

              when there is no index file, it just redirects to the site URL.
              Basicly i got hundreads of folders containing galleries but do not use any index page. users try too type new folders to see if there are more galleries... so i want to use the 404 traffic to feed a tgp.
              Originally posted by rayadp05
              I rebooted, deleted temp files, history, cookies and everything...still cannot view the news clip. All I see is that fucking gay ass music video from "Rick Roll". Anyone else have a different link to the news clip?

              Comment

              • Doctor Dre
                Too lazy to set a custom title
                • Jan 2001
                • 51692

                #8
                Originally posted by Webby
                Again.. not sure

                DirectoryIndex whatever.htm

                ie.. where there is no default index and you want to address a main page as the default index?
                DirectoryIndex http://www.mydomain.com
                That would redirect the index to my domain when there is no index.htm file ?
                Originally posted by rayadp05
                I rebooted, deleted temp files, history, cookies and everything...still cannot view the news clip. All I see is that fucking gay ass music video from "Rick Roll". Anyone else have a different link to the news clip?

                Comment

                • Webby
                  Too lazy to set a custom title
                  • Oct 2002
                  • 14956

                  #9
                  Got ya!

                  We talking 404's to cover this?

                  ErrorDocument 404 /yourpage.htm
                  XXX TLD's - Another mosquito to swat.

                  Comment

                  • DamageX
                    Marketing & Strategy
                    • Jun 2001
                    • 14293

                    #10
                    Originally posted by Doctor Dre
                    Thanks for your time but what I want to do is :

                    when there is no index file, it just redirects to the site URL.
                    Basicly i got hundreads of folders containing galleries but do not use any index page. users try too type new folders to see if there are more galleries... so i want to use the 404 traffic to feed a tgp.
                    Use this then:

                    Code:
                    ErrorDocument 404 http://www.domaintoredirectto.com/pagetoredirectto.html
                    Whitehat is for chumps

                    If you don't do it, somebody else will - true story!

                    Comment

                    • Doctor Dre
                      Too lazy to set a custom title
                      • Jan 2001
                      • 51692

                      #11
                      Originally posted by Webby
                      Got ya!

                      We talking 404's to cover this?

                      ErrorDocument 404 /yourpage.htm
                      If they hit my root directory up and the folder exist it's not a 404 error ...
                      Originally posted by rayadp05
                      I rebooted, deleted temp files, history, cookies and everything...still cannot view the news clip. All I see is that fucking gay ass music video from "Rick Roll". Anyone else have a different link to the news clip?

                      Comment

                      • Webby
                        Too lazy to set a custom title
                        • Oct 2002
                        • 14956

                        #12
                        Originally posted by Doctor Dre
                        If they hit my root directory up and the folder exist it's not a 404 error ...
                        OK!!! Not getting bits yet...

                        If you have a local drive mirror of this content - how about getting a dir listing and making up one default index.htm which simply redirects to "wherever" and letting a batch file stuff a copy into each dir?
                        XXX TLD's - Another mosquito to swat.

                        Comment

                        • Doctor Dre
                          Too lazy to set a custom title
                          • Jan 2001
                          • 51692

                          #13
                          Originally posted by Webby
                          OK!!! Not getting bits yet...

                          If you have a local drive mirror of this content - how about getting a dir listing and making up one default index.htm which simply redirects to "wherever" and letting a batch file stuff a copy into each dir?
                          Too much trouble I have gigs of content on there and I don't wanna waste the day.

                          There is a htaccess code... I know it cauz i was using it... I overwrote it by accident.
                          Originally posted by rayadp05
                          I rebooted, deleted temp files, history, cookies and everything...still cannot view the news clip. All I see is that fucking gay ass music video from "Rick Roll". Anyone else have a different link to the news clip?

                          Comment

                          • Webby
                            Too lazy to set a custom title
                            • Oct 2002
                            • 14956

                            #14
                            Ah... OK Doc... So can be covered at the server end..

                            Any clues as to what was used in the htaccess?

                            Where is ServerGenius when ya need him?
                            XXX TLD's - Another mosquito to swat.

                            Comment

                            • boldy
                              Macdaddy coder
                              • Feb 2002
                              • 2806

                              #15
                              in htaccess (in your DocumentRoot)

                              Options -indexes
                              ErrorDocument 403 /
                              MacDaddy Coder.

                              Comment

                              • Webby
                                Too lazy to set a custom title
                                • Oct 2002
                                • 14956

                                #16
                                This got anything to do with directory browsing??

                                Ah... is it an ErrorDocument 403??
                                XXX TLD's - Another mosquito to swat.

                                Comment

                                • TheSwed
                                  Confirmed User
                                  • Feb 2004
                                  • 3483

                                  #17
                                  Take a look here http://www.freewebmasterhelp.com/tutorials/htaccess/2

                                  maybe you find what you looking for

                                  Cheap Viagra and Cialis Erectionpills

                                  Comment

                                  • boldy
                                    Macdaddy coder
                                    • Feb 2002
                                    • 2806

                                    #18
                                    Originally posted by Webby
                                    This got anything to do with directory browsing??

                                    Ah... is it an ErrorDocument 403??

                                    Well when you turn off directory browsing using : Options -Indexes

                                    then it turns into a 403 forbidden error
                                    MacDaddy Coder.

                                    Comment

                                    • Webby
                                      Too lazy to set a custom title
                                      • Oct 2002
                                      • 14956

                                      #19
                                      Originally posted by boldy
                                      Well when you turn off directory browsing using : Options -Indexes

                                      then it turns into a 403 forbidden error
                                      Got to be something like that which fits whatever is needed
                                      XXX TLD's - Another mosquito to swat.

                                      Comment

                                      Working...