Apache mod_rewrite将重写的URL作为基础URL

Apache mod_rewrite将重写的URL作为基础URL,apache,mod-rewrite,Apache,Mod Rewrite,我的.htaccess RewriteEngine On Options +FollowSymlinks RewriteRule ^posts/(.*)/(.*)/$ index.php?mod=posts&action=cat&cat=$2 RewriteRule ^post/(.*)/(.*)/$ index.php?mod=posts&action=read&id=$2 当我将浏览器指向第一个重写规则时,就会触发,一切正常。 但我有一个这样的链接 <

我的.htaccess

RewriteEngine On
Options +FollowSymlinks

RewriteRule ^posts/(.*)/(.*)/$ index.php?mod=posts&action=cat&cat=$2
RewriteRule ^post/(.*)/(.*)/$ index.php?mod=posts&action=read&id=$2
当我将浏览器指向第一个重写规则时,就会触发,一切正常。 但我有一个这样的链接

<a href="post/post-title/10/"></a>
应该是这样

    http://my-dev-server/post/post-title/10/
它遵循了第一条规则的模式,这显然是错误的


我在这里做错了什么?如何在不必编写绝对URL的情况下修复它?

但是您的
href
是相对于当前页面的,因此它的行为符合预期。也许你想要
我有点简化了,问题是网站不在,但是
    http://my-dev-server/post/post-title/10/