DZ反代后发帖等时提示“您的请求来路不正确,无法提交。”的解决方法
[b]现象:[/b]DZ反向代理后,发帖及回帖等时提示:[quote]您的请求来路不正确,无法提交。[/quote][b]解决:[/b]include\global.func.php的函数submitcheck()中:
[quote] if($allowget || ($_SERVER['REQUEST_METHOD'] == 'POST' && $GLOBALS['formhash'] == formhash() && empty($_SERVER['HTTP_X_FLASH_VERSION']) && (empty($_SERVER['HTTP_REFERER']) ||
preg_replace("/https?:\/\/([^\:\/]+).*/i", "\\1", $_SERVER['HTTP_REFERER']) == preg_replace("/([^\:]+).*/", "\\1", $_SERVER['HTTP_HOST']))))[/quote]
修改为:
[quote] if($allowget || ($_SERVER['REQUEST_METHOD'] == 'POST' && $GLOBALS['formhash'] == formhash() && empty($_SERVER['HTTP_X_FLASH_VERSION']) && (empty($_SERVER['HTTP_REFERER']) ||
preg_replace("/https?:\/\/([^\:\/]+).*/i", "\\1", $_SERVER['HTTP_REFERER']) == preg_replace("/([^\:]+).*/", "\\1", $_SERVER['HTTP_HOST'])[color=Red] ||
'www.abc.com' == preg_replace("/([^\:]+).*/", "\\1", $_SERVER['HTTP_HOST'])[/color])))[/quote]
其中,[url]www.abc.com[/url]是被代理服务器的真实域名。
页:
[1]