.htaccess - How do I redirect a URL with a parameter to a clean URL in htaccess? -


i attempting 301 redirect several urls parameters @ end clean urls.

for example trying redirect: http://example.com/news/news.php?id=1234 http://example.com/posts/vanity-url.php

here code:

rewritecond %{query_string} id=1234 rewriterule ^news/news\.php$ /posts/vanity-url.php [l,r=301] 

i feel i'm close code redirects me to: http://example.com/posts/vanity-url.php?id=1234 , i'm not sure why happening.

i appreciate help. thank you!

add question sign after remove query string

rewriterule ^news/news\.php$ /posts/vanity-url.php? [l,r=301] 

Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -

jdbc - Not able to establish database connection in eclipse -