regex - htaccess link redirect adds parameter -


i trying redirect old menu item new htaccess. works adds parameter not want. code is:

redirect 301 /menu_cars_old.html http://www.domain.com/menu_cars_new.html rewriterule ^/?(menu_+[a-za-z._-]+)$ index.php?menu=$1 [nc,l] 

i not familiar htaccess asking help. redirect 301 statement should trick think has rewrite rule.

redirected link looks http://www.domain.com/menu_cars_new.html?menu=menu_cars_old.html.

if change

redirect 301 /menu_cars_old.html http://www.domain.com/?menu=menu_cars_new.html 

it works don't want parameter in url.

don't mix mod_alias , mod_rewrite rules. here how should have it:

rewriteengine on  rewriterule ^/?menu_cars_old\.html$ http://www.domain.com/menu_cars_new.html [r=301,nc,l] rewriterule ^/?(menu_+[\w.-]+)$ index.php?menu=$1 [nc,l,qsa] 

make sure place code in document_root/.htaccess


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -

php - Accessing static methods using newly created $obj or using class Name -