return FALSE; $r = well_tag_thread__update(array('id' => $id), $update); return $r; } function well_tag_thread_find($tagid, $page, $pagesize) { $arr = well_tag_thread__find(array('tagid' => $tagid), array('id' => -1), $page, $pagesize); return $arr; } function well_tag_thread_find_by_tid($tid, $page, $pagesize) { $arr = well_tag_thread__find(array('tid' => $tid), array(), $page, $pagesize); return $arr; } ?>php - Rewrite rule not working, but only when parameter is text
最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - Rewrite rule not working, but only when parameter is text

programmeradmin2浏览0评论

I have a simple rewrite rule that changes something like /locations/?slug=times-square to /locations/times-square/. The same "location" can be retrieved by ID, so the following URL's all work and retrieve the same data:

/locations/?slug=times-square
/locations/?slug=108366
/locations/108366

The last one shows that my rewrite rule works fine when the slug is a number. The rule is as follows:

RewriteRule   ^locations/(.+)$   locations/?slug=$1   [L]

But writing a URL as follows: /locations/times-square gives me a 404 error, and that's obviously the one I prefer. Is wordpress redirecting this as an error before it even makes it to the rewrite rule? How can I stop this?

发布评论

评论列表(0)

  1. 暂无评论