Re: [PHP] intercepting URLs in a control-system
Hello If you are using PHP as an Apachemodule you also have the option of using a url like http://example.com/index.php/test/test.html Apache will see that test.html is not available and will travel down the directory path til it gets to the index.php (which should exist BTW) and call that script. This seems to work on most default installation of apache using php as apachemodule. (Don't know if this is true for all apache installations and if this still works on apache2) In index.php you can parse the requesturi and decode it appropriatly. Be aware this only works on apache with php as a module and it might not be as fast as mod_rewrite ( and as clean) but it can be used on servers that don't have mod_rewrite installed or where you don't have access to the config or htaccess. Regards Stefan Langer
Re: [PHP] intercepting URLs in a control-system
If you are using PHP as an Apachemodule you also have the option of using a url like http://example.com/index.php/test/test.html Apache will see that test.html is not available and will travel down the directory path til it gets to the index.php (which should exist BTW) and call that script. This seems to work on most default installation of apache using php as apachemodule. (Don't know if this is true for all apache installations and if this still works on apache2) This came up here a week or so ago - it will work with Apache 2.0 if the AcceptPathInfo directive is set correctly: http://httpd.apache.org/docs-2.0/mod/core.html#acceptpathinfo - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] intercepting URLs in a control-system
Please forgive any obvious ignorances on my part, I am just learning PHP... Having read quite a bit on-line, I am interested in trying to trap URLs sent to my site so I can process the request and respond without neccessarily having a real page to serve. If this makes any sense, how do I do it? Because I expect that apache (in my case) would not like a URL that contains extra directories/files and would reject it. An example: Web Site Root: www.abc.com/index.php On that page are a tags to further information but which physically don't exist. It will be automatically generated from a database. For example: www.abc.com/cars/volvo/X70.html If I don't have that directory tree and a file called X70.html. Could I trap the http/URL request (BEFORE apache throws it out) and process it in my PHP control-engine which will find the right information and respond accordingly? Thanks in advance, Alan PS, if there are any examples of this (GPL) which you know of, please just pass me the link. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] intercepting URLs in a control-system
Having read quite a bit on-line, I am interested in trying to trap URLs sent to my site so I can process the request and respond without neccessarily having a real page to serve. If this makes any sense, how do I do it? Because I expect that apache (in my case) would not like a URL that contains extra directories/files and would reject it. Try looking at apache mod_rewrite and see if that will work for you...i have used it to do url rewrites for me and have a main php page handle the requests. -- BigDog -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] intercepting URLs in a control-system
Alan Lord mailto:[EMAIL PROTECTED] on Thursday, October 16, 2003 1:40 PM said: Having read quite a bit on-line, I am interested in trying to trap URLs sent to my site so I can process the request and respond without neccessarily having a real page to serve. If this makes any sense, how do I do it? Yes. Like another poster suggested you'll want to use mod_rewrite. You can turn urls such as www.abc.com/cars/volvo/X70.html into www.abc.com/cars.php?make=volvomodel=X70 Because I expect that apache (in my case) would not like a URL that contains extra directories/files and would reject it. Yes, it's called a 404. HTH, Chris. -- Don't like reformatting your Outlook replies? Now there's relief! http://home.in.tum.de/~jain/software/outlook-quotefix/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] intercepting URLs in a control-system
Another option besides mod_rewrite is ErrorDocument directive in .htaccess: ErrorDocument 404 404.php In 404.php you trap the request, url will be in $_SERVER['REQUEST_URI'] Alan Lord wrote: Please forgive any obvious ignorances on my part, I am just learning PHP... Having read quite a bit on-line, I am interested in trying to trap URLs sent to my site so I can process the request and respond without neccessarily having a real page to serve. If this makes any sense, how do I do it? Because I expect that apache (in my case) would not like a URL that contains extra directories/files and would reject it. An example: Web Site Root: www.abc.com/index.php On that page are a tags to further information but which physically don't exist. It will be automatically generated from a database. For example: www.abc.com/cars/volvo/X70.html If I don't have that directory tree and a file called X70.html. Could I trap the http/URL request (BEFORE apache throws it out) and process it in my PHP control-engine which will find the right information and respond accordingly? Thanks in advance, Alan PS, if there are any examples of this (GPL) which you know of, please just pass me the link. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php