regex - Redirect 301 with params -


i redirecting traffic between old web , new web , need redirect 301 /hotel.php?hotel=lasvegas&lng=es http://www.new-web.com/hotel-las-vegas/

how possible htaccess? have tried

rewriterule ^hotel\.php\?hotel=lasvegas\&lng=es http://www.new-web.com/hotel-las-vegas/ [l,r=301] 

i think error @ regular expression. can me?

you can use code in document_root/.htaccess file:

rewriteengine on rewritebase /  # external redirect actual url pretty 1 rewritecond %{the_request} /hotel\.php\?hotel=lasvegas&lng=es [nc] rewriterule ^ hotel-las-begas? [r=302,l,ne]  # internal forward pretty url actual 1 rewriterule ^hotel-las-vegas/?$ hotel.php?hotel=lasvegas&lng=es [l,qsa,nc] 

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -