wordpress怎样将固定链接中的index.php去除
我们做SEO的,虽然不要求精通深圳网站建设,但也必须知道一些深圳网站建设基础,否则一点小问题都要叫别人帮忙,那就太不应该了。都知道静态网址比动态网址更能让蜘蛛喜爱,哪怕是伪静态,可我们在wrodpress后台进行固定链接设置时,如果选择自定义,那么网站文章页就不能打开,首页是可以打开的。如何解决这个问题呢?那么 深圳网站建设网络工作室现就wordpress设置伪静态固定链接的问题来谈一谈。
原来的网址:http://www.abc.com/index.php/archives/123.htm
目标网址:http://www.abc.com/archives/123.htm
首先要问清楚空间商,你所购买的空间是否支持伪静态,如果支持就可以进行下一步了。
现最常用的空间是WIN与LINX,我们分开说。
1.WIN空间
先将下面这段代码用记事本保存,然后将文件名改为 httpd.ini 。
[ISAPI_Rewrite]
# 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 /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]
2.LINX空间
将下面代码用记事本保存为 .htaccess。
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
将上面保存的文件上传到wordpress安装目录。
现打开网站试试,网址是不是精简了,index.php没有了吧。