I switched a client’s website from concrete5 to Wordpress and we have a bunch of links on google and other sites that now are 404. We are trying to redirect as many of those links as we possibly can.
We put as many of them in our .htaccess file such as
we noticed that if they have a query string at the end of the old URL’s and we tried to google around for a solution but everything we found has to do with one kind of url being redirected. and we have hundreds.
EDIT: If we keep the ?cat=5 or whatever the query string is, it breaks wordpress and goes to our 404 page.
If the query string is breaking the WP site, then the QSD (Query String Discard) is the correct flag … but ONLY if the op is using mod_rewrite (which he is not … the Redirect family is run by mod_alias). It has the same effect as adding a ? with nothing following it in the redirect (kills any existing query string).
BL,
I don’t believe that mod_alias (Redirect) can match the {QUERY_STRING} as it’s handled separately rather than in conjunction with the {REQUEST_URI} string.
If I need to match both the {REQUEST_URI} and {QUERY_STRING}, I would use mod_rewrite. Note, though, that you’ll need a RewriteCond statement to check (or capture) the query string because the RewriteRule can only examine the {REQUEST_URI} string.
If you need more info about mod_rewrite - including explained coding samples for common tasks - then I offer my tutorial at http://dk.co.nz/seo. It has helped MANY SitePoint members over more than 10 years. The power mod_rewrite brings to redirects is that it uses pattern matching to capture and perform redirections using many of Apache’s variables.