If I were to have a url like
https://example.com/books, that contained several links to urls such as:
Would search engines crawl and index the content returned by these URLs? If not, what would happen if I were to use a rewrite rule in my
.htaccess file to rewrite pretty urls to ugly ones with query strings:
Would there be any difference/preference? Or would a search engine crawl both?
Below are the methods you can try. The first solution is probably the best. Try others if the first one doesn’t work. Senior developers aren’t just copying/pasting – they read the methods carefully & apply them wisely to each case.
Yes. Query strings are part of the URL and as such are viewed as directing the robots to different pages.
There may be a preference to using a path because then Google can test the parent. So if you have:
Google will eventually test
on its own (it could be that they don’t do it anymore though, but I’m sure I read that somewhere on a page owned by Google.)
One thing for sure, if you allow both, make sure to add a canonical meta tag with your preferred URL otherwise you could get penalized because of the duplication.