Forum Moderators: open

Message Too Old, No Replies

some confusion over 301's and URL's with query strings

         

plinux

2:29 pm on May 21, 2008 (gmt 0)

10+ Year Member



Hi,

I have a question for you all. Say I have two URL's on my site:

1. http://www.example.com/test.aspx
2. http://www.example.com/test.aspx?id=1

and URL 2. is the URL that has the most inlinks and is the URL that ranks in Google.

If I 301 redirected URL 1. to http://www.example.com/new.aspx
would URL 2. automatically also be 301 redirected to http://www.example.com/new.aspx as well, or would I need to 301 both URL's seperately?

Thanks for your time.

jdMorgan

3:14 pm on May 21, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Technically speaking, both of your examples are the same URL, but the second one has a query string attached to it. To be clear, the query string is not part of the URL, but rather, data attached to the URL that is to be passed to the resource at that URL. This distinction avoids a lot of (relatively-common) confusion.

To answer your question: Unless you take special measures, a redirect of /test.aspx to new.aspx would redirect both cases.

However, in order to avoid duplicate content issues and "stacked" or "chained" multiple redirects, you should modify the redirect code (if possible on your server) so that /test.aspx?id=1 is redirected to /new.aspx --dropping the query string-- and if links to new.aspx?id=1 already exist and have been indexed, then you should also add a second directive to redirect /new.aspx?id=1 to /new.aspx, again dropping the query string.

The above is relatively easy to do with mod_rewrite on Apache, but I'm not sure about IIS.

Jim