首页
web设计
Html
Html教程
正文
如何把动态链接静态化?
一般SEO的技巧里都会提到,搜索引擎对静态网页比较偏好(这个是否成立,姑且不论)。那么如何实现生成静态页面呢?
动态链接静态化,有两种方法:生成静态和伪静态。支持生成静态的wcm有许多,如z-blog。伪静态的实现方式是多样的。
(1)php网站
1、把网页上带链接的地方,都换上新的静态化链接。搜索引擎和浏览器将通过该链接来发生请求。(有些人做修改不是在网页上,而是进行动态链接向静态链接的转向,这是严重错误的)
2、在httpd.conf或.htaccess中使用RewriteRule:
RewriteRule "^/dir/ ([^./]*) \.html" "/dir/script.cgi?doc=$1" [PT]
[PT]标记告诉Apache执行后续的所有操作。
通过这个功能,使动态页面以静态链接的形式展示给搜索引擎,从而达到URL优化的目的。
(2)asp网站
用用ISAPI_Rewrite实现asp的静态化。可参考这篇文章http://wenku.baidu.com/view/af7671d5360cba1aa811da02.html
其实际就是利用IIS的404错误,在该页面根据映射规则,调用相应asp页面。
作者:网络小筑
个人网站:网络小筑
本文版权所有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
SELECT [t0].[a_id], [t0].[a_site], [t0].[a_model], [t0].[a_type], [t0].[a_special], [t0].[a_name], [t0].[a_from], [t0].[a_from_url], [t0].[a_author], [t0].[a_editor], [t0].[a_describe], [t0].[a_content], [t0].[a_create_date], [t0].[a_tag], [t0].[a_hits], [t0].[a_commend], [t0].[a_istop], [t0].[a_isimg], [t0].[a_cacheimg], [t0].[a_imgurls], [t0].[a_imgurl], [t0].[a_ismedia], [t0].[a_mediaurl], [t0].[a_iscomment], [t0].[a_isRecycle], [t0].[a_weight], [t0].[a_weights], [t0].[a_status], [t0].[a_url], [t0].[a_file_path], [t0].[a_contentfile], [t0].[a_comment], [t0].[a_ispass], [t0].[a_bury], [t0].[a_dig], [t0].[a_score], [t0].[a_rank], [t0].[a_diguser], [t0].[a_buryuser], [t0].[a_viewip], [t0].[a_lastviewdate], [t0].[a_neworimageorvideo], [t0].[class_id], [t0].[class_type], [t0].[class_name], [t0].[class_show_name], [t0].[class_parent_id], [t0].[class_id_path], [t0].[class_name_path], [t0].[class_show_name_path], [t0].[class_depth], [t0].[class_order], [t0].[class_content], [t0].[class_img], [t0].[a_model_name]
FROM [dbo].[mvc_content_view] AS [t0]
WHERE ([t0].[a_id] = @p0) AND ([t0].[a_type] = @p1) AND (NOT ([t0].[a_isRecycle] = 1))
-- @p0: Input BigInt (Size = 0; Prec = 0; Scale = 0) [29563]
-- @p1: Input BigInt (Size = 0; Prec = 0; Scale = 0) [248]
-- Context: SqlProvider(Sql2008) Model: AttributedMetaModel Build: 3.5.30729.1
SELECT TOP (1) [t0].[a_id], [t0].[a_name]
FROM [dbo].[mvc_content_view] AS [t0]
WHERE ([t0].[a_type] = @p0) AND ([t0].[a_id] < @p1) AND (NOT ([t0].[a_isRecycle] = 1))
ORDER BY [t0].[a_id] DESC
-- @p0: Input BigInt (Size = 0; Prec = 0; Scale = 0) [248]
-- @p1: Input BigInt (Size = 0; Prec = 0; Scale = 0) [29563]
-- Context: SqlProvider(Sql2008) Model: AttributedMetaModel Build: 3.5.30729.1
SELECT TOP (1) [t0].[a_id], [t0].[a_name]
FROM [dbo].[mvc_content_view] AS [t0]
WHERE ([t0].[a_type] = @p0) AND ([t0].[a_id] > @p1) AND (NOT ([t0].[a_isRecycle] = 1))
ORDER BY [t0].[a_id]
-- @p0: Input BigInt (Size = 0; Prec = 0; Scale = 0) [248]
-- @p1: Input BigInt (Size = 0; Prec = 0; Scale = 0) [29563]
-- Context: SqlProvider(Sql2008) Model: AttributedMetaModel Build: 3.5.30729.1
SELECT TOP (10) [t0].[a_id], [t0].[a_site], [t0].[a_model], [t0].[a_type], [t0].[a_special], [t0].[a_name], [t0].[a_from], [t0].[a_from_url], [t0].[a_author], [t0].[a_editor], [t0].[a_describe], [t0].[a_content], [t0].[a_create_date], [t0].[a_tag], [t0].[a_hits], [t0].[a_commend], [t0].[a_istop], [t0].[a_isimg], [t0].[a_cacheimg], [t0].[a_imgurls], [t0].[a_imgurl], [t0].[a_ismedia], [t0].[a_mediaurl], [t0].[a_iscomment], [t0].[a_isRecycle], [t0].[a_weight], [t0].[a_weights], [t0].[a_status], [t0].[a_url], [t0].[a_file_path], [t0].[a_contentfile], [t0].[a_comment], [t0].[a_ispass], [t0].[a_bury], [t0].[a_dig], [t0].[a_score], [t0].[a_rank], [t0].[a_diguser], [t0].[a_buryuser], [t0].[a_viewip], [t0].[a_lastviewdate], [t0].[a_neworimageorvideo], [t0].[class_id], [t0].[class_type], [t0].[class_name], [t0].[class_show_name], [t0].[class_parent_id], [t0].[class_id_path], [t0].[class_name_path], [t0].[class_show_name_path], [t0].[class_depth], [t0].[class_order], [t0].[class_content], [t0].[class_img], [t0].[a_model_name]
FROM [dbo].[mvc_content_view] AS [t0]
WHERE ([t0].[a_type] IN (@p0)) AND (NOT ([t0].[a_isRecycle] = 1))
ORDER BY [t0].[a_id] DESC
-- @p0: Input BigInt (Size = 0; Prec = 0; Scale = 0) [248]
-- Context: SqlProvider(Sql2008) Model: AttributedMetaModel Build: 3.5.30729.1
SELECT TOP (10) [t0].[a_id], [t0].[a_site], [t0].[a_model], [t0].[a_type], [t0].[a_special], [t0].[a_name], [t0].[a_from], [t0].[a_from_url], [t0].[a_author], [t0].[a_editor], [t0].[a_describe], [t0].[a_content], [t0].[a_create_date], [t0].[a_tag], [t0].[a_hits], [t0].[a_commend], [t0].[a_istop], [t0].[a_isimg], [t0].[a_cacheimg], [t0].[a_imgurls], [t0].[a_imgurl], [t0].[a_ismedia], [t0].[a_mediaurl], [t0].[a_iscomment], [t0].[a_isRecycle], [t0].[a_weight], [t0].[a_weights], [t0].[a_status], [t0].[a_url], [t0].[a_file_path], [t0].[a_contentfile], [t0].[a_comment], [t0].[a_ispass], [t0].[a_bury], [t0].[a_dig], [t0].[a_score], [t0].[a_rank], [t0].[a_diguser], [t0].[a_buryuser], [t0].[a_viewip], [t0].[a_lastviewdate], [t0].[a_neworimageorvideo], [t0].[class_id], [t0].[class_type], [t0].[class_name], [t0].[class_show_name], [t0].[class_parent_id], [t0].[class_id_path], [t0].[class_name_path], [t0].[class_show_name_path], [t0].[class_depth], [t0].[class_order], [t0].[class_content], [t0].[class_img], [t0].[a_model_name]
FROM [dbo].[mvc_content_view] AS [t0]
WHERE ([t0].[a_type] IN (@p0)) AND (NOT ([t0].[a_isRecycle] = 1))
ORDER BY [t0].[a_id] DESC
-- @p0: Input BigInt (Size = 0; Prec = 0; Scale = 0) [248]
-- Context: SqlProvider(Sql2008) Model: AttributedMetaModel Build: 3.5.30729.1
SELECT TOP (10) [t0].[a_id], [t0].[a_site], [t0].[a_model], [t0].[a_type], [t0].[a_special], [t0].[a_name], [t0].[a_from], [t0].[a_from_url], [t0].[a_author], [t0].[a_editor], [t0].[a_describe], [t0].[a_content], [t0].[a_create_date], [t0].[a_tag], [t0].[a_hits], [t0].[a_commend], [t0].[a_istop], [t0].[a_isimg], [t0].[a_cacheimg], [t0].[a_imgurls], [t0].[a_imgurl], [t0].[a_ismedia], [t0].[a_mediaurl], [t0].[a_iscomment], [t0].[a_isRecycle], [t0].[a_weight], [t0].[a_weights], [t0].[a_status], [t0].[a_url], [t0].[a_file_path], [t0].[a_contentfile], [t0].[a_comment], [t0].[a_ispass], [t0].[a_bury], [t0].[a_dig], [t0].[a_score], [t0].[a_rank], [t0].[a_diguser], [t0].[a_buryuser], [t0].[a_viewip], [t0].[a_lastviewdate], [t0].[a_neworimageorvideo], [t0].[class_id], [t0].[class_type], [t0].[class_name], [t0].[class_show_name], [t0].[class_parent_id], [t0].[class_id_path], [t0].[class_name_path], [t0].[class_show_name_path], [t0].[class_depth], [t0].[class_order], [t0].[class_content], [t0].[class_img], [t0].[a_model_name]
FROM [dbo].[mvc_content_view] AS [t0]
WHERE ([t0].[a_type] IN (@p0)) AND (NOT ([t0].[a_isRecycle] = 1))
ORDER BY [t0].[a_hits] DESC, [t0].[a_id] DESC
-- @p0: Input BigInt (Size = 0; Prec = 0; Scale = 0) [248]
-- Context: SqlProvider(Sql2008) Model: AttributedMetaModel Build: 3.5.30729.1