title: How to use apache's mod_rewrite rewriterule without changing relative paths
body: <p>I've the following rewrite rule in .htaccess:</p>
  
  <pre><code>RewriteRule ^groups/([^/\.]+)/?$  groupdetail.php?gname=$1 [L,NC]
  </code></pre>
  
  <p>This takes something like www.example.com/groups/groupname and calls www.example/groupdetail.php?gname=groupname.  And it works just fine.</p>
  
  <p>But all the relative links on groupdetail.php use groups/ as the relative path, and I don't want them to.  How do I avoid this?</p>
  
  <p>For example, when a user clicks on a link <code>&lt;a href="link.php"&gt;</code> on groupdetail.php?gname=groupname, he's taken to www.example/groups/link.php.  I want to take the user to www.example.com/link.php.</p>
  
  <p>Obviously, I want to URL to the user to look like "www.example.com/groups/groupname" so I  don't want to use [R]/redirect.</p>