Google 告诉不要更改动态 URL,而是提供这个,如何?
Google tells do not change dynamic URLs, and offers this instead, how?
If you want to serve a static equivalent of your site, you might want to consider transforming the underlying content by serving a replacement which is truly static. One example would be to generate files for all the paths and make them accessible somewhere on your site.
它们到底是什么意思?以及如何去做?
您的问题:它们到底是什么意思?
如果您想提供网站的静态等价物 - 静态是指 html 不是动态创建的页面。
您可能想考虑通过提供真正静态的替换来转换基础内容。您的 'hard copies' 个页面具有不同的替代方案
一个示例是为所有路径生成文件并使它们可以在您网站的某个位置访问。浏览您的网站并创建静态 html 页面(或pdf) 并将它们存储在由 URL.
表示的文件结构中
最后一个例子:
http://site.tld/product/pear 今天是动态的(由代码和数据库动态创建)但实际上并不在服务器上名为 product 的实际文件夹中。他们建议创建一个动态创建页面的副本,并将其存储在服务器上名为 product 的实际文件夹中,名称为 pear。
你的问题以及如何去做?
这行得通吗——如果你想在物理文件(动态文件的副本)中添加一个 .html 并保存它,但我怀疑你会 运行 进入所有您需要在 .htaccess 等地方使用重定向代码来克服各种困难。另一种选择可能是更改 URL 的域部分以包括静态,即 http://static.site.tld/ 用于静态副本,原始 URL 用于动态版本。
另一个大的挑战是维护这两个副本,因为他们谈论的概念是内容(浏览器中显示的内容)随着时间的推移保持静态。有点打破了我们今天如何构建动态网站的整个概念,例如网店等
例如,如果它是一家商店,我会使用 PHP 在添加产品时创建物理文件并且不包括将要更改的部分,而是包括 link动态信息类似于:
<?php
$file = 'product/pear.html';
// mysql code here to extract the info and format ready for writing
$content = "<html><head><title>$title_from_db</title></head><body>$page_content_from_db</body></html>";
// Write the contents to the file
file_put_contents($file, $content);
?>
If you want to serve a static equivalent of your site, you might want to consider transforming the underlying content by serving a replacement which is truly static. One example would be to generate files for all the paths and make them accessible somewhere on your site.
它们到底是什么意思?以及如何去做?
您的问题:它们到底是什么意思?
如果您想提供网站的静态等价物 - 静态是指 html 不是动态创建的页面。
您可能想考虑通过提供真正静态的替换来转换基础内容。您的 'hard copies' 个页面具有不同的替代方案
一个示例是为所有路径生成文件并使它们可以在您网站的某个位置访问。浏览您的网站并创建静态 html 页面(或pdf) 并将它们存储在由 URL.
表示的文件结构中最后一个例子: http://site.tld/product/pear 今天是动态的(由代码和数据库动态创建)但实际上并不在服务器上名为 product 的实际文件夹中。他们建议创建一个动态创建页面的副本,并将其存储在服务器上名为 product 的实际文件夹中,名称为 pear。
你的问题以及如何去做?
这行得通吗——如果你想在物理文件(动态文件的副本)中添加一个 .html 并保存它,但我怀疑你会 运行 进入所有您需要在 .htaccess 等地方使用重定向代码来克服各种困难。另一种选择可能是更改 URL 的域部分以包括静态,即 http://static.site.tld/ 用于静态副本,原始 URL 用于动态版本。
另一个大的挑战是维护这两个副本,因为他们谈论的概念是内容(浏览器中显示的内容)随着时间的推移保持静态。有点打破了我们今天如何构建动态网站的整个概念,例如网店等
例如,如果它是一家商店,我会使用 PHP 在添加产品时创建物理文件并且不包括将要更改的部分,而是包括 link动态信息类似于:
<?php
$file = 'product/pear.html';
// mysql code here to extract the info and format ready for writing
$content = "<html><head><title>$title_from_db</title></head><body>$page_content_from_db</body></html>";
// Write the contents to the file
file_put_contents($file, $content);
?>