Say I have a rewrite that needs to pass the url to a PHP function and retrieve a value in order to tell what the new destination should be? is there a way to do that?
Thanks.
UPDATE:
Thanks so far guys..I am still having trouble but i'll show you my code:
.htaccess
#I got the file path by echoing DOCUMENT_ROOT and added the rest.
RewriteMap fixurl prg:/var/www/vhosts/mydomain.com/httpsdocs/domain_prototype/code_base/url_handler.php
RewriteEngine On
RewriteRule (.*) ${fixurl:$1} [PT]
PHP:
set_time_limit(0); # forever program!
$keyboard = fopen("php://stdin","r");
while (1) {
$line = trim(fgets($keyboard));
print "www.google.com\n"; # <-- just test to see if working.
}
However I am getting a 500 Internal Server Error I am not sure if there is an error in my .htaccess or in my PHP?