.htaccess question $50 award.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zentz
    Confirmed User
    • Nov 2003
    • 8062

    #1

    .htaccess question $50 award.

    I have multiple dirs like this

    /my.subdomain.com/subfolder_1/0001/index.html
    /my.subdomain.com/subfolder_2/0002/index.html
    /my.subdomain.com/subfolder_3/0003/index.html

    They all have their own index.html file. I want to make them share one identical index.html which will be located in /my.subdomain.com/index.html

    How can i do this with .htaccess? Is it possible or do i need to use symlinks?

    $50 epassporte to the first one that post the solution.

    Thank you
    Programs that owe me money ---- Epassporte.com ~ $2700 | Protraffic.com ~ $2600 | XonDemand.com ~ $3000

    Email: [email protected]
  • Klen
    • Aug 2006
    • 32234

    #2
    If you have ssh access,then you can simply do ln index.html //my.subdomain.com/subfolder_1/0001/index.html
    which will create symbolic link to original file.Repeat same command to all subfolders where you want to have identical file.
    Last edited by Klen; 10-26-2009, 06:05 AM.

    Comment

    • comeplay
      Confirmed User
      • Nov 2004
      • 1435

      #3
      ln -s /my.subdomain.com/index.html index.html
      Top virtual hosts for under 10$? www.hostmylife.com | icq 50663030

      Comment

      • Klen
        • Aug 2006
        • 32234

        #4
        Originally posted by comeplay
        ln -s /my.subdomain.com/index.html index.html
        Yes need to be s switch.

        Comment

        • zentz
          Confirmed User
          • Nov 2003
          • 8062

          #5
          the problem is there are hundreds of subfolders so it needs to be a batch command or something.
          Programs that owe me money ---- Epassporte.com ~ $2700 | Protraffic.com ~ $2600 | XonDemand.com ~ $3000

          Email: [email protected]

          Comment

          • Klen
            • Aug 2006
            • 32234

            #6
            Well in htaccess this should work:
            RewriteCond %{HTTP_HOST} !^www\.mydomain\.com
            RewriteRule (.*) http://www.mydomain.com/$1 [L,R=301]

            RewriteCond %{REQUEST_FILENAME} !^/web
            RewriteCond /home/path/to/public_html/%{REQUEST_FILENAME} !-f
            RewriteCond /home/path/to/public_html/%{REQUEST_FILENAME} !-d
            RewriteCond /home/path/to/public_html/%{REQUEST_FILENAME} !-l
            RewriteRule ^(.+) /web$1

            Comment

            • darksoul
              Confirmed User
              • Apr 2002
              • 4997

              #7
              this works for both situations:
              /subfolder/0001/index.html and
              /subfolder/0001/

              Code:
              RewriteEngine On
              RewriteBase /
              RewriteCond %{REQUEST_URI} ^(/.*)/index.html$ [OR]
              RewriteCond %{REQUEST_URI} ^(/.*)?/$
              RewriteCond %{REQUEST_URI} !^/index.html$
              RewriteRule . /index.html [L]
              1337 5y54|)m1n: 157717888
              BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
              Cambooth

              Comment

              • V_RocKs
                Damn Right I Kiss Ass!
                • Nov 2003
                • 32448

                #8
                Darksoul... good guy if you need something done on the server!

                Comment

                • zentz
                  Confirmed User
                  • Nov 2003
                  • 8062

                  #9
                  darksoul provided the best solution so the money was sent to him.

                  thank you
                  Programs that owe me money ---- Epassporte.com ~ $2700 | Protraffic.com ~ $2600 | XonDemand.com ~ $3000

                  Email: [email protected]

                  Comment

                  • Fat Panda
                    Porn is Dead. Move along.
                    • Aug 2006
                    • 13296

                    #10
                    good work darksoul

                    Comment

                    • seeandsee
                      Check SIG!
                      • Mar 2006
                      • 50945

                      #11
                      nice done
                      BUY MY SIG - 50$/Year

                      Contact here

                      Comment

                      • darksoul
                        Confirmed User
                        • Apr 2002
                        • 4997

                        #12
                        nice working with you
                        1337 5y54|)m1n: 157717888
                        BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
                        Cambooth

                        Comment

                        • Robocrop
                          Confirmed User
                          • Aug 2008
                          • 2785

                          #13
                          Code:
                          RewriteEngine On
                          RewriteBase /
                          RewriteCond %{REQUEST_URI} ^(/.*)/index.html$ [OR]
                          RewriteCond %{REQUEST_URI} ^(/.*)?/$
                          RewriteCond %{REQUEST_URI} !^/index.html$
                          RewriteRule . /index.html [L]
                          DO I WINNN???????????

                          Comment

                          Working...