18910140161

wordpress设置url伪静态方法

顺晟科技

2019-08-16 15:35:17

147

因为搜索引擎对于静态网址的收录要好过动态网址,所以url的设置好坏对网站的seo的影响非常大。

如果网站一开始没有做好URL优化,之后再对网站的URL进行改动的时候,搜索引擎会认为你网站原本所有的页面都被删除 了,并且出现了大量的重复页面,甚至会被判断为采集站点!而搜索引擎对于突然出现大量404页面以及采集站点的打击是很严格的,只要你的URL改动了没有 做好处理,那么对网站将会引来灭顶之灾。

wordpress设置url伪静态

设置固定链接:进入后台—设置—固定链接—常用设置—自定义结构,修改为/category%/%post_id%.html(category:文章类别,post_id:文章id)

因为这里使用到分类的别名,所以在设置分类的时候别名尽量用简练的字母,虽然可以使用中文,但中文出现在url中,始终对搜索引擎不友好。

ps:另外能否伪静态是与网站空间有关系的,有些空间是不正常伪静态的

在虚拟主机下,这样设置还不能让网址静态化。如果只设置wordpress的固定链接,打开内容页会显示页面不存在。要使其成功伪静态还需在根目录下添加 httpd.ini 文件,在httpd.ini里面加上:

[ISAPI_Rewrite]

# Defend your computer from some worm attacks

#RewriteRule .*(?:global.asa|default\.ida|root\.exe|\.\.).* . [F,I,O]

# 3600 = 1 hour

CacheClockRate 3600

RepeatLimit 32

# Protect httpd.ini and httpd.parse.errors files

# from accessing through HTTP

# Rules to ensure that normal content gets through

RewriteRule /tag/(.*) /index\.php\?tag=$1

RewriteRule /software-files/(.*) /software-files/$1 [L]

RewriteRule /images/(.*) /images/$1 [L]

RewriteRule /sitemap.xml /sitemap.xml [L]

RewriteRule /favicon.ico /favicon.ico [L]

# For file-based wordpress content (i.e. theme), admin, etc.

RewriteRule /wp-(.*) /wp-$1 [L]

# For normal wordpress content, via index.php

RewriteRule ^/$ /index.php [L]

RewriteRule /(.*) /index.php/$1 [L]

相关文章
我们已经准备好了,你呢?
2024我们与您携手共赢,为您的企业形象保驾护航