2

As far as I understand, you should have a single URL to access a given page on a website to prevent duplicate issues. With this in mind I have setup IIS7 Rewrite to point my friendly URLs to my .aspx pages. e.g. /category/widgets/ has a rewrite to /category.aspx?id=widgets

Should I allow either of these URLs to resolve my web page, or should I also 301 redirect /category.aspx?id=widgets to /category/widgets/ so that there is only a single URL that resolves the page?

3
  • What is a 301 rewrite? If you're rewriting the URL, then it shouldn't be sending a 301 redirect response. The rewriting should happen internally with the client simply receiving a 200 OK response with the contents. Dec 22, 2011 at 6:33
  • Yes, you're right. I've edited the question accordingly. Dec 22, 2011 at 6:59
  • Thanks for fixing that. I was just worried that you might create a redirect loop if you have two 301 redirects pointing to each other. Dec 22, 2011 at 7:01

1 Answer 1

2

Yes, you should 301 redirect /category.aspx?id=widgets to /category/widgets/ so that there is only a single URL that resolves the page.

Make sure that you don't accidentally create a redirect loop.

The alternate way is to use the rel="canonical" meta-tag in your code, but as you are using IIS7 the redirect should be simpler to implement.

2
  • As an alternative to the 301 redirect, would I be better returning a 404 response to /category.aspx?id=widgets? Jan 10, 2012 at 11:48
  • No - your original pages may have links pointing to them. Returning a 404 will cause any reputation built up to be lost. Pass the reputation along by redirecting with a 301.
    – Ciaran
    Jan 11, 2012 at 15:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.