I want to redirect these URLs forum.tld/archive/index.php/t-1052.html forum.tld/archive/index.php/t-1052.html?q=randomlygeneratedstring to the following URL via .htaccess, forum.tld/threads/1052 Does anyone know how to do that? Thanks.
Try: Redirect 301 /archive/index.php/t-1052.html forum.tld/threads/1052 add http to forum.tld/threads/1052
Try this code. Your server must have "mod_rewrite" module enabled for this to work: RewriteEngine on RewriteRule ^archive/index\.php/t-([0-9]+)\.html(.+)?$ /threads/$1 [R=301,L] Code (markup): Have a look here for more reference: http://www.yourhtmlsource.com/sitemanagement/urlrewriting.html
Thanks. But when I open forum.tld/archive/index.php/t-1052.html?q=randomlygeneratedstring in my browser, it redirects me to forum.tld/threads/1052?s=randomlygeneratedstring. Is there a way to remove that parameter "s"?