This class can emulate a page request URL rewriting and redirection specified within the same PHP script.
It can a PHP script handle a request with an URI like this:
/home/name.php?p1=a&p2=b&xy=123
when it is requested a page with an URI like this:
/goto/home/name/xyz/NQw/NQi/RwSy=/index.html
or, optionally with strong encoding, to with an URI like this:
/goto/home/name/xyz/Sm9obZjhsz6s/amBzb29zdC5jb20=/MTIU2NzgY1g==/index.html
The request redirection emulation is done by rewriting some request variables that contain request paths, like SCRIPT_FILENAME, SCRIPT_NAME, PHP_SELF, REQUEST_URI, PATH_TRANSLATED, and QUERY_STRING.
It can parse and change the output of the current page script to rewrite the URLs links (also in image maps) or images in the page with absolute URLs, relative URIs and URLs that contain scheme and host (http://www.somehost.com). Relative parent directory URIs (../) are also supported.
You can do the rewriting by using PHP buffering support.
Then the class optionally can compress the processed page output to serve the page in less time if the user browser supports compression.
Or you can rewrite a string with the string-rewrite method, if you cannot (or don't) want use the buffering support.
For detailed description see readme file.
|