Forum Moderators: Robert Charlton & goodroi
Consider what happens when a user removes part of your URL -
Some users might navigate your site in odd ways, and you should
anticipate this. For example, instead of using the breadcrumb links
on the page, a user might drop off a part of the URL in the hopes
of finding more general content. He or she might be visiting http://
www.brandonsbaseballcards.com/news/2010/upcoming-baseballcard-shows.htm,
but then enter http://www.brandonsbaseballcards.com/news/2010/ into
the browser's address bar, believing that this will show all news from
2010. Is your site prepared to show content in this situation or will
it give the user a 404 ("page not found" error)?
[edited by: Robert_Charlton at 7:06 am (utc) on Oct 12, 2011]
[edit reason] fixed example link display problem [/edit]
Does that mean I should avoid rewriting dynamic URLs at all?
That's our recommendation, unless your rewrites are limited to removing unnecessary parameters, or you are very diligent in removing all parameters that could cause problems. If you transform your dynamic URL to make it look static you should be aware that we might not be able to interpret the information correctly in all cases. If you want to serve a static equivalent of your site, you might want to consider transforming the underlying content by serving a replacement which is truly static. One example would be to generate files for all the paths and make them accessible somewhere on your site. However, if you're using URL rewriting (rather than making a copy of the content) to produce static-looking URLs from a dynamic site, you could be doing harm rather than good. Feel free to serve us your standard dynamic URL and we will automatically find the parameters which are unnecessary.
If you transform your dynamic URL to make it look static you should be aware that we might not be able to interpret the information correctly in all cases
www.example.com/index.php?product=12532&maker=acme&size=large&colour=blue www.example.com/product/12532/maker/acme/size/large/colour/blue www.example.com/product/12532/maker/ is quite meaningless. Is your site prepared to show content in this situation or will it give the user a 404 ("page not found" error)?
403 forbidden i'm not so keen on
As a user, if I find directory structure in your url I expect to be able to use it. Either have index pages, or be able to redirect me to an appropriate page, even if that page is the home page.