.htaccess - Replace spaces with hyphen in query string in htaccess -


i need when type url this: http://www.example.com/fountain%20hills-condos-townhouses %20 or space replaced hyphen. htacces is:

#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 

i should value of $_request['search_by'] fountain-hills

try adding right below rewriteengine on:

rewritecond %{query_string} ^(.+)(?:\ |%20)(.+)$ rewriterule ^(.*)$ /$1?%1-%2 [l,r] 

Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -