【发布时间】:2009-06-24 14:12:59
【问题描述】:
假设我有一个重写,需要将 url 传递给 PHP 函数并检索一个值,以便告诉新的目的地应该是什么?有没有办法做到这一点?
谢谢。
更新:
到目前为止,谢谢大家..我仍然遇到问题,但我会向您展示我的代码:
.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.
}
但是我收到 500 内部服务器错误我不确定我的 .htaccess 或 PHP 中是否有错误?
【问题讨论】: