301 Redirects, and the correct regex to go with it
- by Tisch
Hi Guys,
I have several URLs that I want to redirect to the same place, however these are dynamic URLs.
The structure is something like this:
http://www.mysite.com/declaration/list?[query_string]
What I think would be ideal for this situation is to use some regex in my .htaccess file to redirect all these links to the sites home page.
I was wondering if someone could help me with the regex for this situation. So far, I have this, but it doesn't work:
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^/declaration/list$ http://www.mysite.com/$ [R=301,L]
My regex is weak to say the least, something I want to, and am trying to learn.
Thanks in advance.
Tom