问题原文
原帖链接 · dudi · CC BY-SA 4.0
I am building a open blog website which users can create posts. Whenever a user creates post, it is being inserted to database and fetching its heading from database in the main page. Whenever a visitor clicks the heading of some post, it goes to a URL like
example.com?subject=places_to_visit_in_new_york
Also, today I generated a sitemap and it doesn't include those posts because they are not real pages and they are being called via a PHP function. I just sent my sitemap to Google and so far Google isn't indexing posts. (Which I understand.)
I checked other forums and their URLs are like
example.com/places_to_visit_in_new_york
Should my page be creating a new file for each post or can I keep going using a parameter for SEO?
If you tell me I can keep going this way, how can I understand if Google indexes posts? If a new file must be created for each post,can you tell me how to do it?
已采纳解答
原帖链接 · Shahzeb Qureshi · CC BY-SA 4.0
The url example.com/places_to_visit_in_new_york
can be created dynamically depending on the framework/language your website is based on. This means that you don't have to create separate files for seperate urls just like using the query string format.
Consider the example of Wordpress where you have the option of choosing between multiple url patterns under the permalinks section
example.com/posts?id=1example.com/my-new-post
The most preferred format is the second one
The reason can be understood by reading this article Keep a simple URL structure
A site's URL structure should be as simple as possible. Consider organizing your content so that URLs are constructed logically and in a manner that is most intelligible to humans (when possible, readable words rather than long ID numbers). For example, if you're searching for information about aviation, a URL like
http://en.wikipedia.org/wiki/Aviationwill help you decide whether to click that link. A URL likehttp://www.example.com/index.php?id_sezione=360&sid=3a5ebc944f41daa6f849f730f1, is much less appealing to users.
However query strings in url are also common when it comes to filtering your content or pagination. But keep in mind that Google crawls and indexes content on both url formats unless there is content duplication or some other issue.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
