2

Suppose I have a .htaccess file, which would take a SEO-friendly URLs like www.site.com/sub-category/spices, www.site.com/sub-category/vegetables etc, and redirect them to the file www.site.com/sub-category/page_generator.php?item=spices. That is, page_generator.php would take the last part of the URL as a GET parameter, and then generate the page with database calls.

I do not know a lot a about search engines, but I think that a search engine cannot see page_generator.php (since it's hidden by .htaccess), and thus associates the resulting webpage with the URL www.site.com/sub-category/spices, and not www.site.com/sub-category/page_generator.php?item=spices, which is good in terms of SEO.

Is this correct?

1

Is this correct?

Basically, yes.

redirect them to the file...

It's more usual to refer to this as a URL rewrite (or internal rewrite), rather than a "redirect" - which is more commonly used to refer to an (external) HTTP redirect. Although it is still a redirect of sorts and the Apache docs do often refer to it as an "internal redirect".

which is good in terms of SEO.

Strictly speaking, these are "user"-friendly URLs, not necessarily SEO-friendly. Search engines understand the URL parameters perfectly well - so to the search engines it makes little difference. However, users find them easier to deal with, which can improve click-through rates. So, indirectly, they can help draw traffic to your site, but they do nothing to improve your ranking directly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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