2014-09-23 84 views
0

我需要当我输入这样的url:http://www.example.com/Fountain%20Hills-condos-townhouses然后%20或空格被连字符替换。 我htacces是:用htaccess中的连字符替换空格

#Options +FollowSymLinks 
Options +SymLinksIfOwnerMatch -Indexes 
RewriteEngine On 
RewriteCond %{HTTP_HOST} ^example.com 
RewriteRule (.*) http://www.example.com/$1 [R=301,L] 
RewriteRule (.*)-condos-townhouses$ index.php?cond_option=and&page=1&nextprev=0&searchBtn=0&displaylim=30&search_by=$1&search_cat_type=city&keyword=City&propType=2&listing_types=2&sortby=&searchpost=1&popup_in_seconds=1&is_popup_show=1&last_neighborhood=20&last_school=50&last_zips=20 

我应该得到的$ _REQUEST值 'search_by']是喷泉山

回答

0

尝试增加以下RewriteEngine On这一权利:

RewriteCond %{QUERY_STRING} ^(.+)(?:\ |%20)(.+)$ 
RewriteRule ^(.*)$ /$1?%1-%2 [L,R] 
+0

喜@乔恩林。 。,我有网址像http://siteurl.com/search_results.asp?s=st%20christophers%20chain 和http://siteurl.com/search_results.asp?s=st%20christophers 它有多个空间( %20)在网址中,如何管理这.. ..? 帮帮我.. – VijayS91 2015-03-30 12:55:11

相关问题