How to make movable type to use relative path

363 Views Asked by At

Commonly movable type will publish HTML files which contains absolute path, but if I want to host the site under different domain(e.g., both HTTP and HTTPS), it is very inconvenient.

So is there a way to change all the paths to resource of my site to absolute ones?

Thanks

2

There are 2 best solutions below

1
On

I think you want "reletive" paths. The relative directories can be symlinked/aliased on the server. Once file paths are aliased...

Update your mt-config.cgi file to use reletive paths for the required config directives:

This is also covered in the installation guide

0
On

Short of constructing the URLs yourself in your templates, you'll need a plugin. I've found that MTRelativeURL works well, despite not being updated in a while.

The plugin adds a few new tags but the simple approach is to use the 'relative_url' filter where needed:

<$MTEntryPermalink relative_url="1"$>

Keep in mind that you'll want to continue using absolute URLs for the links in your RSS feed.