NiceWords中文版 NiceWords英文版
登录 / 注册

URL模式

本站支持 Rewrite 模式 和 PathInfo 模式。

PathInfo 模式

形式如:
http://www.nicewords.cn/show.php/show/2323
http://www.nicewords.cn/index.php/tag/mm/2
http://www.nicewords.cn/index.php/page/25

不需要特别配置。一般的虚拟主机都支持。

Rewrite 模式

形式如:
http://www.nicewords.cn/show/2323
http://www.nicewords.cn/tag/mm/2
http://www.nicewords.cn/page/25

看上去跟静态页面一样,有较好的用户体验和SEO效果。强烈建议。如果您的空间支持.htaccess ,网站根目录下已经有 .htaccess 文件了。您也可以直接复制里面的内容放在apache配置文件中。 如果使用其他系统,也有相应的解决方法,只需要按照.htaccess文件的内容配置即可。

下面是url重写需要的内容
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^show/([0-9]*)[/]{0,1}$ /show.php?id=$1
    RewriteRule ^tag/(.*)/([0-9]*)[/]{0,1}$ /index.php?tag=$1&page=$2
    RewriteRule ^tag/(.*)[/]{0,1}$ /index.php?tag=$1
    RewriteRule ^page/([0-9]*)[/]{0,1}$ /index.php?page=$1
</IfModule> 
(注意:如果你的模式里不支持0-9这样的,请将 “0-9” 改成 “d” ,如果还不支持,请直接改成“.” )

Windows下 Rewrite 模式配置

  1. 点击这里下载IIS Rewrite组件,已经写好规则
  2. 将 Rewrite 拷贝到 c:\Rewrite 或者其他任何一个没有中文字符和空格的目录下
  3. 在IIS的Isapi上添加这个筛选器, 筛选器名称Rewrite,可执行文件选择 Rewrite.dll
  4. 重新启动IIS
  5. httpd.ini 是配置文件,如果您了解Rewrite 规则,可以直接对其进行编辑, NiceWords的规则已经默认写在里面了
测试: 在您的站点地址后加 /page/1 ,如 http://www.baguola.cn/page/1 ,如果能打开,说明配置成功了。!

另外,你需要下面的设置:
  1. 登录NiceWords后台,将 URL模式设置为“使用url rewrite”
  2. 保存。看看你的地址栏里是不是没有了 index.php show.php 这样的了,哈哈,成功了。
对于DZ的Rewrite插件,重写规则如下:
[ISAPI_Rewrite]
CacheClockRate 3600

RepeatLimit 32

RewriteRule ^/show/([0-9]*)[/]{0,1}$ /show\.php\?id=$1
RewriteRule ^/tag/(.*)/([0-9]*)[/]{0,1}$ /index\.php\?tag=$1&page=$2
RewriteRule ^/tag/(.*)[/]{0,1}$ /index\.php\?tag=$1
RewriteRule ^/page/([0-9]*)[/]{0,1}$ /index\.php\?page=$1

自定义URL

NiceWords 2.0以后的版本中,支持用户自定义URL形式。 如,将文章页默认的show/2323 这种形式定义成 show-2323.html / article/2323.htm / article/2323-WenZhangBiaoTiPingYing 等
请在后台管理 -> url设置 中管理
售前咨询
技术支持
付款/投诉
010-82828275