Re: Re: Search like php.net's URL thingy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294807

Also, why would you want Google let's say, to receive a 404 Not Found header for http://php.net/arrays???

-Shawn

Nate Tallman wrote:
Not true, Apache does return a 404, but IE will use the custom 404 page if it is available.

Nate

On Thu, Jun 5, 2008 at 2:57 PM, Shawn McKenzie <nospam@xxxxxxxxxxxxx <mailto:nospam@xxxxxxxxxxxxx>> wrote:

    As far as I remember, errordocument still send the code, in this
    case 404 to the client.  In the case of IE, this will display IEs
    built-in error doc if the server supplied one is < 512 Bytes.
     Maybe other implications for spiders also.  I might be wrong, but
    this is from some old memory.

    -Shawn

    Nate Tallman wrote:

        ErrorDocument 404 /path/to/some/script.php
        * $_SERVER['REDIRECT_URL']

        (somehow misplaced underscore)

        On Thu, Jun 5, 2008 at 2:50 PM, Nate Tallman
        <nate.tallman@xxxxxxxxxxxxxxxxxxx
        <mailto:nate.tallman@xxxxxxxxxxxxxxxxxxx>
        <mailto:nate.tallman@xxxxxxxxxxxxxxxxxxx
        <mailto:nate.tallman@xxxxxxxxxxxxxxxxxxx>>> wrote:

           Why not just set:
           ErrorDocument 404 /path/to/some/script.php
           Then check $SERVER['REDIRECT_URL'] for the failed request.




           On Thu, Jun 5, 2008 at 2:41 PM, Shawn McKenzie
           <nospam@xxxxxxxxxxxxx <mailto:nospam@xxxxxxxxxxxxx>
        <mailto:nospam@xxxxxxxxxxxxx <mailto:nospam@xxxxxxxxxxxxx>>>
        wrote:

               Ryan S wrote:

                   Hey,
                   one of the things that make the php.net
        <http://php.net> <http://php.net>

                   site so cool is how easy it is to find info for a
        function
                   or a list of topics.. eg:

                   http://php.net/arrays
                   http://php.net/count

                   I'm sure nearly all of you reading this have done
        it more
                   times than you would care to count, i'm trying to get
                   something like this on my own site but even after
        going to
                   php.net <http://php.net> <http://php.net> and
        clicking on the view source

                   buttons am a bit confused.

                   basically this is what i am trying, people who type in
                   http://www.mysite.com/asdf
                   should not be shown a 404 not found page but instead
                   "asdf" should be passed onto my script where i can do a
                   search on the term and either give them back the
        results
                   of that search or direct them to a custom 404 page.

                   since i couldnt find the answer via php.net
        <http://php.net>
                   <http://php.net>'s source i started messing around
        with

                   how i *think* its done... tell me if i am on the
        correct
                   track: when someone requests a page that does not
        exist, a
                   .htaccess file them up and also takes the page name
        they
                   were searching for and redirects them to a script...
                   So far i have only been able to get the .htaccess file
                   point to my custom 404 page... but how do i get it
        to pass
                   the parameter of the not-found-page to my script?

                   Would appreciate any code, tips, urls you can give me.

                   Thanks!
                   Ryan



                    ------
                   - The faulty interface lies between the chair and the
                   keyboard.
                   - Creativity is great, but plagiarism is faster!
                   - Smile, everyone loves a moron. :-)



               If you use .htaccess and have mod_rewrite then it is
        simpler.
                Something like this (untested):


               <IfModule mod_rewrite.c>
                  RewriteEngine On
                  RewriteCond %{REQUEST_FILENAME} !-d
                  RewriteCond %{REQUEST_FILENAME} !-f
                  RewriteRule ^(.*)$ index.php?term=$1 [L]
               </IfModule>

               Then in index.php you can use the contents of
        $_GET['term'],
               which in your example would be asdf.

               [QSA,L] will give you the query string if the user typed in
               something like http://www.mysite.com/asdf?your=mom.

               Then $_GET['your'] = 'mom'.

               -Shawn


               --        PHP General Mailing List (http://www.php.net/)
               To unsubscribe, visit: http://www.php.net/unsub.php





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux