Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

This question already has an answer here:

I have learned how to retrieve data from a database to a single page by using a form, so I would not need to create many pages to show the elements of a catalog. The concern that I have is how to make this database content available for search engines.

I have read that I need my site to generate different URLs for each search result, but in my test, the webpage always has the same URL without any additional parameter. I know that sites like Facebook and similar generate particular URLs for each profile and they are indexed, but I don't know if "physical" files exist for them or how this is done. I have read similar questions to this, but still can't figure how to generate the URLs.

share|improve this question

marked as duplicate by Stephen Ostermiller Jan 29 at 18:31

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

up vote 2 down vote accepted

The URLs should be something like www.example.com/?id=XXX. Based on the ID parameter, you can extract the required data from your database and pass it in the response.

I have learned how to retrieve data from a database to a single page by using a form

I think you are using the POST method in your form, and because of that the parameters will be passed to your application in the request body and not in the URL.

Use the GET method instead. If the URL on which the form is passed is /abc.html and the form parameter is an ID, then the URLs should be in the form of: /abc.html?id=XXX. But Google's web crawler cannot fill in your form to crawl those URLs, so you should create a page containing a list of all those URLs. Whether the user submits the form and goes to the URL, or types the /abc.html?id=XXX URL into his browser, the response from the server should be the same.

Assuming that you are using PHP, this might be helpful to you (see the "Get Method" section).

share|improve this answer
    
Thanks for this useful information. –  user35454 Jan 29 at 9:06
    
@SakhalTurkaystan :) –  Ranjith Jan 29 at 17:06