Help with mod_rewrite

Help with mod_rewrite

Posted by: dpix
Posted on: 2006-03-02 10:05:00

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

I've got my Movable Type install on xxx.com and plugin (tags.app) that handles all tag searches at eg. xxx.com/mt/mt-tags.cgi and of course receives ugly URL calls 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 yyy.com and what I'm trying to do is get yyy.com/tag/whatever to rewrite into the xxx.com tag script.

I thought this rewrite would work in an htaccess file placed in the blog's yyy.com root;

RewriteEngine on
RewriteRule ^tag/(.+) /home/.dhserver/servername/xxx.com/mt/mt-tags.cgi?blog_id=7&tags=$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.
Cheers.

Re: Help with mod_rewrite

Posted by: daisygirl
Posted on: 2006-03-03 11:05:00

I'm sure someone who knows more about this than me will come along and answer, but in the meantime I'd try taking the /home/.dhserver/servername/ part out. (I didn't test it but none of my rewrites use that kind of path.)

Edited by daisygirl on 03/03/06 11:06 AM (server time).

Re: Help with mod_rewrite

Posted by: phpfunk
Posted on: 2006-03-06 21:55:00

RewriteEngine on
# you want to rewrite to a url, not a file, so you don't need file path in rule
RewriteRule ^tag/(.+) mt-tags.cgi?blog_id=7&tags=$1 [QSA,L]

What is the full url where mt-tags.cgi is located? If its not under your top directory where you serve pages from, then you'll need to adapt the rewrite rule to fit.

Tags: ugly urlmodxxxcgimovable typeapacheblogtag