大网数据广告活动
网站运营与故障问答

Can I use a query parameter for SEO, or do I need to create a URL path for each page?

· 52CE 我爱测

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…

问题原文

原帖链接 · 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

  1. example.com/posts?id=1
  2. example.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/Aviation will help you decide whether to click that link. A URL like http://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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2019-05-03)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。