Hi, I'm trying to redirect any URL beginning with http://www.magle.dk/ubbthreads/ (tens of thousands of different URLs) to one single page: http://www.magle.dk/music-forums/ except a few URLs that I am manually redirecting elsewhere. For example I'm manually redirecting http://www.magle.dk/ubbthreads/showflat.php/Cat/0/Number/51 to http://www.magle.dk/music-forums/23-bach-toccata-fugue-d.html using a standard 301 redirect, but there are tons of other "ubbthreads" pages (with other structures) so I cannot redirect every single of them manually. Only a few. The rest I'd simply like to redirect to the new forum root. I know I have to use a mod_rewrite instead of a regular 301 redirect, but I'm pretty much stuck right now. Any help would be highly appreciated
I tried using the following code: RewriteRule ^ubbthreads(.+)$ http://www.magle.dk/music-forums/ [R=301,L] Code (markup): And it seems to work, BUT it also overwrites the manual 301 redirects. How can I make specific 301 redirects overwrite the above rewriterule? Please, any help very appreciated, thanks in advance. EDIT: AHHHHH, of course stupid me... The solution: RewriteRule ^ubbthreads/showflat.php/Cat/0/Number/51 http://www.magle.dk/music-forums/23-bach-toccata-fugue-d.html [R=301,L] RewriteRule ^ubbthreads(.+)$ http://www.magle.dk/music-forums/ [R=301,L] Code (markup): This works. Are there any pitfalls using the above code? Finally. One problem: whenever one of the redirected URLs include dynamic content example http://www.magle.dk/ubbthreads/showthreaded.php?Cat=0&Number=1430&page=2&fpart=&vc=1 Code (markup): the resulting URL will be http://www.magle.dk/music-forums/?Cat=0&Number=1430&page=2&fpart=&vc=1 Code (markup): . It still works - the page loads and just seems to ignore everything from the ? - but I'm afraid Google might see it as massive duplicate content. Thousands of pages with various dynamic URLs but same content. How to get the dynamic content redirected to the single URL as well?
I found the solution, just in case anyone should be interested: Simply adding a question mark like this: RewriteRule ^ubbthreads(.+)$ http://www.magle.dk/music-forums/? [R=301,L] Code (markup): That does the trick. Any URL including dynamic ones with query strings will now be redirected to just the one page without any additional queries.