.htaccess question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cluck
    Confirmed User
    • Dec 2002
    • 5248

    #1

    .htaccess question

    Anyone know how I can make it so if a person visits(for example) http://mydomain.com/hey-i-just-made-this-up.htm but that page doesn't exist, the host responds like it does exist but runs another script to return the content?
    icq 279990726
    www.mcdonalds.com <- great money making opportunity
  • powerbubba
    Confirmed User
    • Jan 2004
    • 358

    #2
    perhaps getting into more details, are you wanting your server to send a 302 (Found) message back to the browser instead of a 404 (Not Found) message, then also provide content as well?

    Or are you wanting to do a simple redirect on all 404 error messages?
    GreatGirls.com
    [email protected]
    CrowsCrypt.com - Exclusive High Quality Goth
    www.crowscrypt.com

    Comment

    • cluck
      Confirmed User
      • Dec 2002
      • 5248

      #3
      Originally posted by powerbubba
      perhaps getting into more details, are you wanting your server to send a 302 (Found) message back to the browser instead of a 404 (Not Found) message, then also provide content as well?

      Or are you wanting to do a simple redirect on all 404 error messages?
      I want it to make it seem to the browser like the file is actually there.
      icq 279990726
      www.mcdonalds.com <- great money making opportunity

      Comment

      • Wiz
        Confirmed User
        • Dec 2002
        • 223

        #4
        Bump ;)

        I need the same info
        and if its working with diff extention , like pdf etc etc

        IE:

        I have a folder called /temp/
        I have ONLY 1 file, blabla.pdf in this folder

        I want to link from many html pages , many differents names to join this pdf like /temp/toto.pdf /temp/tata.pdf

        So the server provide the content of blabla.pdf to all other file reuqests.

        Thanks!
        !

        Comment

        • Fu-Q
          Confirmed User
          • Jul 2003
          • 1546

          #5
          Originally posted by Wiz
          Bump ;)

          I need the same info
          and if its working with diff extention , like pdf etc etc

          IE:

          I have a folder called /temp/
          I have ONLY 1 file, blabla.pdf in this folder

          I want to link from many html pages , many differents names to join this pdf like /temp/toto.pdf /temp/tata.pdf

          So the server provide the content of blabla.pdf to all other file reuqests.

          Thanks!
          if you are pointing them all to the same file, why not use a redirect
          AIM - X8U
          ICQ - 195301080

          Comment

          • Wiz
            Confirmed User
            • Dec 2002
            • 223

            #6
            For some reason ..

            I need the server to provide the content from the original file without doing some mod on the url in the nav bar
            !

            Comment

            • arial
              Confirmed User
              • Jul 2002
              • 4012

              #7
              Ok well if I understand you right (which I don't thing I don't) add this to your 404.shtml:

              PHP Code:
              <!--#include virtual="/path/to/script.php" --> 
              
              Then a make a php script (example script.php) and do this in it:

              PHP Code:
              <? include("/path/to/content.page"); ?>
              Make sure 404 is at least 550 bytes if I remember right.

              Comment

              • jwerd
                Confirmed User
                • Jun 2003
                • 1953

                #8
                *cough* mod_rewrite *cough*

                hahaha
                Yii Framework Guru - Seasoned PHP vet - Partner @ XXXCoupon.com

                Comment

                • jwerd
                  Confirmed User
                  • Jun 2003
                  • 1953

                  #9
                  Anyone needing this done to your server, I can do it for a reasonable price...say $50.00 and have it installed and running perfectly on your server (provided you have php/apache/mysql and mod_rewrite turned on) ....

                  hit me up on icq or email me!

                  [email protected]
                  304634638

                  lamerhooD
                  Yii Framework Guru - Seasoned PHP vet - Partner @ XXXCoupon.com

                  Comment

                  • Wiz
                    Confirmed User
                    • Dec 2002
                    • 223

                    #10
                    All in *on* already ;)

                    Just need the line to add to the Htaccess ;)
                    !

                    Comment

                    • cluck
                      Confirmed User
                      • Dec 2002
                      • 5248

                      #11
                      Bumb

                      I don't want to redirect the traffic, I don't think wiz does either. I need it to have my script output it as if the page existed. My script will dynamically create the page based on what the requested filename was.

                      icq 279990726
                      www.mcdonalds.com <- great money making opportunity

                      Comment

                      • hudson
                        Confirmed User
                        • Jul 2003
                        • 2948

                        #12
                        apache docs?

                        Comment

                        • cluck
                          Confirmed User
                          • Dec 2002
                          • 5248

                          #13
                          Found it.

                          # - Send all htm requests to script - #
                          options all
                          RewriteEngine on
                          RewriteBase /
                          RewriteRule htm /your/script.php
                          # - End - #
                          icq 279990726
                          www.mcdonalds.com <- great money making opportunity

                          Comment

                          • cluck
                            Confirmed User
                            • Dec 2002
                            • 5248

                            #14
                            Originally posted by hudson
                            apache docs?
                            Real men don't need docs
                            icq 279990726
                            www.mcdonalds.com <- great money making opportunity

                            Comment

                            • hudson
                              Confirmed User
                              • Jul 2003
                              • 2948

                              #15
                              Originally posted by cluck


                              Real men don't need docs

                              Comment

                              Working...