所以我需要在這種情況下,我需要解析出proptype=rental
和發送整個事情301重定向基於變量在POST
www.xyz.com/search-results.php?city%5B%5D=Boynton+Beach&proptype=rental&foreclosure=&price_from=0&price_to=0&footage_from=&footage_to=&bedrooms_from=&bedrooms_to=&bathrooms_from=&bathrooms_to=&pets=&year_from=&year_to=&pool=
www.xyzRentals.com/search-results.php?city%5B%5D=Boynton+Beach&proptype=rental&foreclosure=&price_from=0&price_to=0&footage_from=&footage_to=&bedrooms_from=&bedrooms_to=&bathrooms_from=&bathrooms_to=&pets=&year_from=&year_to=&pool=
我知道我需要添加一些正則表達式來解析.htaccess文件中的url,並做一個301 ...任何快速的想法如何做到這一點?我試過
RedirectMatch 301 ^search-results.php?(.*)proptype=rental(.*)$ http://www.xyzRentals.com/search-results.php?$1proptype=rental$2
,但沒有工作,我不知道爲什麼......當我把正則表達式爲匹配它說,它不匹配,但仍沒有重定向。
ANSWER
所以我最終做jQuery中......
var searchType = $('#proptype').val();
if (searchType == 'rental') {
$('#form').attr('action','http://www.floridaspropertymanagement.com/search-results.php');
}
$('#form').submit();
tyvm ...工作..我結束了在js做它 – menriquez