当前位置: 代码迷 >> PHP >> 关于伪静态的写法,帮忙
  详细解决方案

关于伪静态的写法,帮忙

热度:456   发布时间:2016-04-28 21:38:04.0
关于伪静态的写法,请教高手帮忙
我使用apache作为服务器,安装wordpress,

现在写了一个自定义的链接

做出来是:http://127.0.0.1/wordpress/go/index.php?pid=399
但我想变为http://127.0.0.1/wordpress/go/399.html

听说要写伪静态,请高手帮忙哈

------解决方案--------------------
RewriteRule ^wordpress/go/([0-9]+)\.html$ wordpress/go/index.php?pid=$1 [L]

------解决方案--------------------
不要做无谓的尝试!
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
将所有的访问都定向到了 index.php

这是他设计好的伪静态运行方式,不能改动
既然你要用 WordPress ,就得按他的规矩来
  相关解决方案