.htaccess - How do I redirect dynamic URLs with parameters? -
the old urls this: http://mywebsite.com/index.php?mode=thread&id=284607
the new urls be: http://mywebsite.com/threads/284607
as can see, want grab id # old dynamic urls , point them new pretty urls.
i've tried finding solution here , elsewhere, keep having problems removing "mode=thread" part redirect.
thanks help!
update: here's other code in .htaccess file.
rewritecond %{request_filename} -f [or] rewritecond %{request_filename} -l [or] rewritecond %{request_filename} -d rewriterule ^.*$ - [nc,l] rewriterule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [nc,l] rewriterule ^.*$ index.php [nc,l]
after lot of googling, found work:
rewritecond %{query_string} (^|\?)mode=thread&id=([0-9]+)($|&) rewriterule ^index\.php$ http://mywebsite.com/threads/%2/? [r=301,l]
Comments
Post a Comment