0

so this is my url:

http://www.mysite.com/mypage.php?PropertyBuyRent=rent&Developer=&Resort=&City=&State=&Country=&Price=

I want to write the following htaccess:

if PropertyBuyRent=rent and Resort value is not empty then url should be like:

http://www.mysite.com/mypage.php/TimeshareForRent/Marriott's+Grande+Ocean+Resort (whatever value comes from the url for Resort)

4

1 回答 1

0

您可以使用此规则:

RewriteEngine On

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+(testing/mypage\.php)\?PropertyBuyRent=rent&Developer=&Resort=([^&]+)&City=&State=&Country=&Price= [NC]
RewriteRule ^ /%1/TimeshareForRent/%2? [R=301,L,NE]

RewriteRule ^(testing/mypage.php)/TimeshareForRent/([^/]+)/?$ /$1?PropertyBuyRent=rent&Developer=&Resort=$2&City=&State=&Country=&Price= [L,NC,QSA]
于 2013-10-09T15:00:45.930 回答