服务器未提取重写规则

时间:2015-05-27 05:31:58

标签: php regex apache mod-rewrite xampp

我不确定为什么 mod_rewrite.c 没有正确路径链接

示例网址

http://developer.prodev/dev_www_trunk/justink/public_html/search/manufacturer/hewlett-packard

重写引擎

http://developer.prodev/dev_www_trunk/justink/public_html/search/index.php?advanced=0&manufacturer_rewrite=hewlett-packard

我已经在htaccess tester

上测试了我的重写规则

rewrite_result

但是这不一样的结果,我进入了 error_log.log ,重定向到 justink / search / manufacturer /... public_html < / strong>未能重写内容。)

# dev_www_trunk/justink/public_html/search/manufacturer/hewlett-packard 
RewriteRule ^(dev_[^/]*)/justink/public_html/search/manufacturer/?(.*)$ /$1/justink/public_html/search/index.php?advanced=0&manufacturer_rewrite=$2%{QUERY_STRING} [L]

1 个答案:

答案 0 :(得分:1)

来自日志:

'^(dev_[^/]*)/justink/public_html/search/manufacturer/?(.*)$' to uri 'search/manufacturer/hewlett-packard'

你的正则表达式中有很多前缀信息。如您所见,提供给正则表达式的URL仅为

'search/manufacturer/hewlett-packard'

我相信您还希望重定向到新的HTTP位置而不是文件,以便mod_phpphp-fpm解释您的重定向请求:

RewriteRule /search/manufacturer/?(.*)$ http://%{HTTP_HOST}/search/index.php?advanced=0&manufacturer_rewrite=$1%{QUERY_STRING} [L]