Help with mod_rewrite

software development


This is a friendly call for help to anyone familiar with the apache mod_rewrite script.

I’ve got my Movable Type install on and using plugin ( that handles all tag searches at eg. and of course receives ugly queries in the form of mt-tags.cgi?blog_id=7&tags=$1

I have a blog on the same DH server on a different domain and what I’m trying to do is get to rewrite into the tag script.

I thought this rewrite would work in an htaccess file placed in the blog’s root;

RewriteEngine on
RewriteRule ^tag/(.+) /home/.dhserver/servername/$1 [QSA,L]

However, it’s not working. Can anyone tell me what I’m doing wrong with my syntax or htaccess placement?

Thanks in advance to anyone who can offer up some advice.


Please don’t double post.

Simon Jessey
Keystone Websites | si-blog


Sorry, my bad.
I just realized after the fact that it was a question that belonged in here.


mod_rewrite URLs are relative to the web site root, not the filesystem root. So the above rule should be written like this:

RewriteEngine on RewriteRule ^tag/(.+) /mt/mt-tags.cgi?blog_id=7&tags=$1 [QSA,L]

If you want useful replies, ask smart questions.


Ok, much thanks for the suggestion.
Quick follow-up question:
Where should the htaccess file be placed?
In the root of the domain folder for the blog or the root of the domain folder for the mt install? Or both?

Thanks again for your help!


For this rule to work, it should go in the root directory of your site. Compare the URIs in the rule to see why it won’t work from a subdirectory (hint: look at the directories, or lack thereof, in the path you’re matching).

If you want useful replies, ask smart questions.