Warning: Use of undefined constant smart_ads_days - assumed 'smart_ads_days' (this will throw an Error in a future version of PHP) in /www/wwwroot/welovelead.net/wp-content/plugins/smart-ads/smartads.php on line 341
最近welovelead搬家,遇到不少细节问题,这里给大家说一下windows主机伪静态的问题。
为啥要伪静态?如果不做伪静态,wordpress博客文章的格式是http://www.abc.net/?p=123 这个样子的,这种动态链接据说不利于搜索引擎优化,所以我们要把他变成http://www.abc.net/123这样的。这就是所谓的伪静态。
那怎么做呢?其实特别简单,按照下面的步骤来:
步骤1:新建记事本,把下面的代码粘贴进去
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
# wordpress 伪静态规则
# For tag(中文标签以及标签翻页的规则)
RewriteRule /tag/(.*)/page/(\d+)$ /index\.php\?tag=$1&paged=$2
RewriteRule /tag/(.+)$ /index\.php\?tag=$1
# For category(中文分类以及分类翻页的规则)
RewriteRule /category/(.*)/page/(\d+)$ /index\.php\?category_name=$1&paged=$2
RewriteRule /category/(.*) /index\.php\?category_name=$1
# For sitemapxml
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:把这个记事本另存为httpd.ini(注意,文件类型要选择所有文件)。
步骤3:把这个httpd.ini文件上传到你的网站根目录。
步骤4:现在可以在wordpress后台修改你想要的网址格式了。
常用格式如下:
%year%:日志发表的年份,四位数字,如2009
%monthnum%:日志发表的月份,如05
%day%:日志发表的日期,如28
%hour%:日志发表的时间(小时),如15
%minute%:日志发表的时间(分钟),如43
%second%:日志发表的时间(秒),如33
%postname%:日志标题的缩略版本(日志/页面编辑界面上的日志别名)。因此“This Is A Great Post!”在URI中会变成this-is-a-great-post。
%post_id%:日志的唯一ID,如423
%category%:分类名称的缩略版本(添加新分类/编辑界面上的分类别名)。嵌套的子分类会作为嵌套子目录出现在URI中。出于运行方面的考虑,不推荐以%category%作为固定链接的起始部分。
%tag%:标签名称的缩略版本(添加新标签/编辑界面上的标签别名)。出于运行方面的考虑,不推荐以%tag%作为固定链接的起始部分。
%author%:作者名称的缩略版本。

这个不错!谢谢博主