.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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -