On Fri, April 21, 2006 1:11 pm, tg-php@xxxxxxxxxxxxxxxxxxxxxx wrote: > You could do that... a "poor man's mod_rewrite" might involve > something like this and making the main PHP parsing script your 404 > page.. so no matter where you went on a page, the 404 redirect to your > PHP script would parse the request (or would you get the > post-redirected URL? in which case you'd have to get the 'referrer' > maybe? not sure..). Actually, I consider it a vastly superior solution to mod_rewrite for several reasons: #1. Don't have to restart Apache just to add some new wrinkle. [When your mod_rewrite rules are in httpd.conf and not .htaccess] #2. Works on all servers, including shared servers where mod_rewrite and/or .htaccess is turned completely off for perofrmance. #3. Screwing up a rule doesn't take down your whole site, or everything below the directory of your .htaccess -- You only screw up one page where you are messing with the rules of the translation. #4. About 100 X simpler to understand than mod_rewrite regular expression syntax and all that L/R business I never did figure out, really. #5. It's PHP. :-) #6. Can log specific data about interesting rules, not a monolithic and sometimes quite expensive logging for debugging. > Sounds like it could have some security issues though..giving too much > power to the user and what they enter in the URL being used as > variable data.. definitely would want to scrub that input hard. You would scrub it EXACTLY the same way you scrub GET data, POST data, and COOKIE data. You are literally just translating the search not-so-friendly: script.php?x=5&y=7 into the very search friendly: script.php/x=5/y=7 Also note that for rich media such as PDF and FDF, some versions of IE will simply choke on: http://example.com/test.pdf?whatdate=7-1-2006 But they're quite happy with: http://example.com/test/whatdate=7-1-2006/whatever.pdf In fact, there is NO WAY the browser can tell that it's not retrieving a plain ol' PDF just by looking at the URL. And that's a very good thing because browsers suck at dynamic rich media such as images, PDF, etc -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php