Re: [PHP] Re: Search like php.net's URL thingy
P.S will be deleting the urls that you created, hope you dont mind, coz just in case someone later keeps using the url you posted via the archives... Hang on, I want to post it on Digg first Hehe, no fear there... all my posts on dig never get me more than a few clicks anyway... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Search like php.net's URL thingy
Ah, the never ending loop... thanks for pointing that out. Thats why I love this place... theres so many ways to skin a cat and here they tell you the ways you have forgotten or overlooked. Thanks again, R P.S will be deleting the urls that you created, hope you dont mind, coz just in case someone later keeps using the url you posted via the archives... -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) - Original Message From: Daniel Brown [EMAIL PROTECTED] To: Ryan S [EMAIL PROTECTED] Cc: Stut [EMAIL PROTECTED]; Iv Ray [EMAIL PROTECTED]; Jon Drukman [EMAIL PROTECTED]; php-general@lists.php.net Sent: Thursday, June 19, 2008 4:40:59 PM Subject: Re: [PHP] Re: Search like php.net's URL thingy Ry, Make sure you also disable the ability to add in your own site, and even similar competitors such as tinyurl.com. Otherwise, you'll get something like this: http://ezee.se/30 -- /Daniel P. Brown Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just $59.99/mo. with no contract! Dedicated servers, VPS, and hosting from $2.50/mo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Search like php.net's URL thingy
At 11:35 AM -0700 6/20/08, Ryan S wrote: Thats why I love this place... theres so many ways to skin a cat Yeah, but the cat ain't going to like any of them. (Foxworthy) Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Search like php.net's URL thingy
clip Thats why I love this place... theres so many ways to skin a cat Yeah, but the cat ain't going to like any of them. (Foxworthy) /clip Hehe good one! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Search like php.net's URL thingy
On Fri, Jun 20, 2008 at 2:35 PM, Ryan S [EMAIL PROTECTED] wrote: Ah, the never ending loop... thanks for pointing that out. Thats why I love this place... theres so many ways to skin a cat and here they tell you the ways you have forgotten or overlooked. As long as you remember to give back more than you take. The more you learn, the more you can teach and help others down the road. P.S will be deleting the urls that you created, hope you dont mind, coz just in case someone later keeps using the url you posted via the archives... Hang on, I want to post it on Digg first -- /Daniel P. Brown Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just $59.99/mo. with no contract! Dedicated servers, VPS, and hosting from $2.50/mo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Search like php.net's URL thingy
On Fri, 2008-06-20 at 14:42 -0400, tedd wrote: At 11:35 AM -0700 6/20/08, Ryan S wrote: Thats why I love this place... theres so many ways to skin a cat Yeah, but the cat ain't going to like any of them. (Foxworthy) I'd have to argue that the above claim is only true if the cat is still alive :) Although, I'm sure someone is gonna get all metaphysical on my ass now. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Search like php.net's URL thingy
clip I really dont see what anybody could gain by spamming this form but anyway it does check to make sure the person submits something that starts with http via strstr (after bringing it down to lowercase, thats why i didnt use stristr, and because it checks just http, https too is allowed, i really dont think people will have much use for FTP or other protocols here so didnt bother, it also safeguards my server from people trying to serve up my local files).. Yeah, that's not so great: http://ezee.se/d /clip yep, but the above url is pretty much useless, its unable to access my filesystem and does... nothing, so other than a kid (and smart ass programmers) fooling around, who would want to do soemthing like that? clip You could probably stop a lot of that by checking URLs against http://www.surbl.org/ before allowing them. /clip Thanks, thats a good idea and i think i'll work with it. Cheers! R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Search like php.net's URL thingy
Ry, Make sure you also disable the ability to add in your own site, and even similar competitors such as tinyurl.com. Otherwise, you'll get something like this: http://ezee.se/30 -- /Daniel P. Brown Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just $59.99/mo. with no contract! Dedicated servers, VPS, and hosting from $2.50/mo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Search like php.net's URL thingy
Ryan S wrote: Thanks for replying m8, but if you check the rest of the thread you will see this has alraedy been solved and the result is http://ezee.se/ezeeurl.php?do=1 Cheers! Ryan How do you protect this thing from being spammed? I do not know why somebody would spam it, but I have had all kind of forms being spammed - it seem there are people out there who find immense pleasure in spamming forms, regardless of the result. Iv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Search like php.net's URL thingy
Why is an ErrorDocument insufficient or not the elegant way? It accomplishes the goal in a clean way, no? It's *WRONG*. ErrorDocument still preserves the 404 error code, it just gives it a prettier face. If the page really is there, returning a 404 for it is not correct. Search engines will not index it. You probably don't want that. You may set it... so for example: header('HTTP/1.1 200 OK'); Regards, Philip
Re: [PHP] Re: Search like php.net's URL thingy
On Tue, Jun 17, 2008 at 3:22 PM, Jon Drukman [EMAIL PROTECTED] wrote: Nate Tallman wrote: Why is an ErrorDocument insufficient or not the elegant way? It accomplishes the goal in a clean way, no? It's *WRONG*. ErrorDocument still preserves the 404 error code, it just gives it a prettier face. If the page really is there, returning a 404 for it is not correct. Search engines will not index it. You probably don't want that. Not to beat a dead horse, but why would you *not* want to preserve the 404? If it's a bad url anyways, you probably *want* to return a 404 (albeit prettier) and you probably *don't* want search engines indexing it.
Re: [PHP] Re: Search like php.net's URL thingy
On Wed, Jun 18, 2008 at 9:19 AM, Nate Tallman [EMAIL PROTECTED] wrote: Not to beat a dead horse, but why would you *not* want to preserve the 404? If it's a bad url anyways, you probably *want* to return a 404 (albeit prettier) and you probably *don't* want search engines indexing it. the original question was not how to serve fancy 404's, it was how to serve urls like http://php.net/strtolower you definitely want those indexed. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Search like php.net's URL thingy
clip Thanks for replying m8, but if you check the rest of the thread you will see this has alraedy been solved and the result is http://ezee.se/ezeeurl.php?do=1 Cheers! Ryan How do you protect this thing from being spammed? I do not know why somebody would spam it, but I have had all kind of forms being spammed - it seem there are people out there who find immense pleasure in spamming forms, regardless of the result. /clip I really dont see what anybody could gain by spamming this form but anyway it does check to make sure the person submits something that starts with http via strstr (after bringing it down to lowercase, thats why i didnt use stristr, and because it checks just http, https too is allowed, i really dont think people will have much use for FTP or other protocols here so didnt bother, it also safeguards my server from people trying to serve up my local files).. If i do see spam, will throw in a captcha... there are many other there that are decent, i might not go for enter the below characters one but most probably click the elephant/cat/dog/mouse in the picture one. If that does not work, will either have to ask for their credit card numbers or ask them to mail me their birth certificates... :o) J/K of course! Cheers! R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Search like php.net's URL thingy
On 18 Jun 2008, at 23:40, Ryan S wrote: clip Thanks for replying m8, but if you check the rest of the thread you will see this has alraedy been solved and the result is http://ezee.se/ezeeurl.php?do=1 Cheers! Ryan How do you protect this thing from being spammed? I do not know why somebody would spam it, but I have had all kind of forms being spammed - it seem there are people out there who find immense pleasure in spamming forms, regardless of the result. /clip I really dont see what anybody could gain by spamming this form but anyway it does check to make sure the person submits something that starts with http via strstr (after bringing it down to lowercase, thats why i didnt use stristr, and because it checks just http, https too is allowed, i really dont think people will have much use for FTP or other protocols here so didnt bother, it also safeguards my server from people trying to serve up my local files).. Yeah, that's not so great: http://ezee.se/d If i do see spam, will throw in a captcha... there are many other there that are decent, i might not go for enter the below characters one but most probably click the elephant/cat/dog/mouse in the picture one. If that does not work, will either have to ask for their credit card numbers or ask them to mail me their birth certificates... :o) J/K of course! The only spam you're likely to see here is spammers using the service to mask URLs they send out via other channels. Not much you can do about that but it's likely to get your main domain name banned by some spam filters. You could probably stop a lot of that by checking URLs against http://www.surbl.org/ before allowing them. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Search like php.net's URL thingy
Ryan S wrote: Hey! Thanks for replying. Digging a bit more i found IfModule mod_rewrite.c RewriteEngine On RewriteRule ^([a-z][0-9][A-Z][aA0-zZ0])$ jj.php?show=$1 /IfModule But it does not work :( do you see any fault with the above? this is an apache issue, not a php issue, so you'll probably have better luck on an apache mailing list. however i will tell you that apache handles URLs in .htaccess differently from in the normal httpd.conf files. in the .htaccess file, the URL presented to RewriteRule does NOT have a leading /. in the conf file, it will. so your rule might work if you do this: RewriteRule ^/([a-z][0-9][A-Z][aA0-zZ0])$ jj.php?show=$1 i'm guessing that you are using .htaccess though, in which case the problem becomes the rule itself. your regex is not going to do what you think. it's saying lower case letter followed by number followed by uppercase letter followed by i don't know what the heck that is. try: RewriteRule ^(\w+)$ jj.php?show=$1 [L] \w is equivalent to [A-Za-z0-9_] note that this is NOT the same as [A-Z][a-z][0-9] you almost always want [L] in a situation like this to prevent later rules from messing with your rewritten string. also i will tell you that if you ever plan to launch this feature on a site that gets significant traffic, turning off .htaccess file checking is a HUGE performance win. unfortunately you will have to restart apache every time you want to modify your rewrite rules, but them's the breaks. -jsd- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Search like php.net's URL thingy
Nate Tallman wrote: Why is an ErrorDocument insufficient or not the elegant way? It accomplishes the goal in a clean way, no? It's *WRONG*. ErrorDocument still preserves the 404 error code, it just gives it a prettier face. If the page really is there, returning a 404 for it is not correct. Search engines will not index it. You probably don't want that. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Search like php.net's URL thingy
It's *WRONG*. So are vegetables. Long live the waffle! BTW, anyone seen this: http://code.google.com/apis/chart/ ...? More to the point, is anyone using it commercially? -- Richard Heyes Employ me: http://www.phpguru.org/cv ++ | Access SSH with a Windows mapped drive | |http://www.phpguru.org/sftpdrive| ++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Search like php.net's URL thingy
Thanks for replying m8, but if you check the rest of the thread you will see this has alraedy been solved and the result is http://ezee.se/ezeeurl.php?do=1 Cheers! Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Search like php.net's URL thingy
Ryan S wrote: Hey, one of the things that make the 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 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'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
Re: [PHP] Re: Search like php.net's URL thingy
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 [EMAIL PROTECTED] wrote: Ryan S wrote: Hey, one of the things that make the 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 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'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
Re: [PHP] Re: Search like php.net's URL thingy
ErrorDocument 404 /path/to/some/script.php * $_SERVER['REDIRECT_URL'] (somehow misplaced underscore) On Thu, Jun 5, 2008 at 2:50 PM, Nate Tallman [EMAIL PROTECTED] 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 [EMAIL PROTECTED] wrote: Ryan S wrote: Hey, one of the things that make the 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 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'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
Re: [PHP] Re: Search like php.net's URL thingy
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 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 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 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Ryan S wrote: Hey, one of the things that make the 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 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'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
Re: [PHP] Re: Search like php.net's URL thingy
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 [EMAIL PROTECTED] 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 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 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 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Ryan S wrote: Hey, one of the things that make the 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 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'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
Re: [PHP] Re: Search like php.net's URL thingy
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 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 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 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 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 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 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
Re: [PHP] Re: Search like php.net's URL thingy
Correction for my statement: As long as the content length is greater than 512 bytes, IE will display the content from the 404. Less than that and it will display it's own pretty message. http://www.404-error-page.com/404-error-page-too-short-problem-microsoft-ie.shtml http://www.mattcutts.com/blog/404-pages-in-google-toolbar/ On Thu, Jun 5, 2008 at 3:06 PM, Shawn McKenzie [EMAIL PROTECTED] wrote: 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 [EMAIL PROTECTED]mailto: [EMAIL PROTECTED] 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 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 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 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 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
Re: [PHP] Re: Search like php.net's URL thingy
clip 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) clip Your memory might be old... but its still good! :) While searching for my answers i did come accross what you wrote above.. Cheers! R P.S Thanks for replying guys -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Search like php.net's URL thingy
Why is an ErrorDocument insufficient or not the elegant way? It accomplishes the goal in a clean way, no? Nate On Thu, Jun 5, 2008 at 3:25 PM, Yeti [EMAIL PROTECTED] wrote: still telling Ryan to produce errors is insufficient or at least not the elegant way On 6/5/08, Nate Tallman [EMAIL PROTECTED] wrote: Correction for my statement: As long as the content length is greater than 512 bytes, IE will display the content from the 404. Less than that and it will display it's own pretty message. http://www.404-error-page.com/404-error-page-too-short-problem-microsoft-ie.shtml http://www.mattcutts.com/blog/404-pages-in-google-toolbar/ On Thu, Jun 5, 2008 at 3:06 PM, Shawn McKenzie [EMAIL PROTECTED] wrote: 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 [EMAIL PROTECTED] mailto: [EMAIL PROTECTED] 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 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 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 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 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
Re: [PHP] Re: Search like php.net's URL thingy [0.T]
Hey again, First of all please note that i added a [0.T] (= off topic ) to the subject so if you dont want to continue with something OT, now's the time... Ok... for anyone thats curious as to why i wanted this.. just completed my version of tinyURL... except, its even more tiny!! Have christened it ezeeURL :) if anyone wants to take it for a test spin (as its not officially open yet) feel free to check it out here: http://ezee.se/a.html Thought i would do something with my small domain name... and this worked out pretty good, for example: http://tinyurl.com/ http://ezee.se/ -- Size does matter! cant beat tiny if you even have MICROurl coz tiny is smaller :p but ezee does beat tiny plus .se is smaller than .com... now if only it could beat it in traffic! Cheers! R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Search like php.net's URL thingy [0.T]
On Thu, Jun 5, 2008 at 4:52 PM, Ryan S [EMAIL PROTECTED] wrote: Hey again, First of all please note that i added a [0.T] (= off topic ) to the subject so if you dont want to continue with something OT, now's the time... Ok... for anyone thats curious as to why i wanted this.. just completed my version of tinyURL... except, its even more tiny!! Have christened it ezeeURL :) if anyone wants to take it for a test spin (as its not officially open yet) feel free to check it out here: http://ezee.se/a.html It worked for me, first try. I had built a site like this years ago, but never used it. If you're missing code for anything, let me know and I'll see if I can dig it up for you. -- /Daniel P. Brown Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just $59.99/mo. with no contract! Dedicated servers, VPS, and hosting from $2.50/mo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Search like php.net's URL thingy [0.T]
Hello, php.net uses a 404 error handler for this, and most mirrors store url data in an sqlite database. A simple $_SERVER dump in your 404 page will show you which variables are available. Regards, Philip