Simulating separate trackback and comment URLs with Movable Type

| No Comments | No TrackBacks
One problem that I see a complaint about every so often with Movable Type is that you have several independent blogs that use the same URL to get to their trackback and comment scripts. To get around this, I discovered a little trick. Modify your templates so that each template points explicitly to the URL of your blog, assuming it's on a separate domain. For example, change all references to the trackback script to explicitly point to http://www.domain2.com/mt/mt-tb.cgi if your installation of Movable Type is hosted at http://www.domain1.com/mt/. Now, create a symlink between "mt" in the directory that hosts domain2.com and your mt directory under domain1.com/mt. Then, in the root directory of domain2.com, add the following statement to .htaccess (create a file named .htaccess if it doesn't exist):

Options +FollowSymlinks
That's it! Now, whenever someone points to http://www.domain2.com/mt/mt-tb.cgi, it should be internally mapped, without any problems, to http://www.domain1.com/mt/mt-tb.cgi. I tested this out with the trackbacks and it worked fine.
For those that don't know how to create a symlink on a UNIX system, the command is:

ln -s DIRECTORY_TO_LINK TO NAME_FOR_SYMLINK

Assuming a directory structure of:

/home/me/public_html/mt
/home/me/public_html/domain2

where /home/me/public_html is the root directory of domain1.com at your host, ln -s /home/me/public_html/mt /home/me/public_html/domain2/mt would work.

Related Entries:

Printer-friendly version

No TrackBacks

TrackBack URL: http://www.codemonkeyramblings.com/mt/mt-tb.cgi/724

Leave a comment

June 2009

Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30        

Tips

OpenID accepted here Learn more about OpenID

Creative Commons License
This blog is licensed under a Creative Commons License.
Powered by Movable Type 4.261