开发者

Existing movable type plugin that does URL shortening and redirection?

开发者 https://www.devze.com 2023-04-07 22:56 出处:网络
We send out a newsletter that has URLs in it. Rather than having foreign URLs directly, they all come to our website and then redirect to the outside world.

We send out a newsletter that has URLs in it. Rather than having foreign URLs directly, they all come to our website and then redirect to the outside world.

Right now the redirects are all done with HTML files. My goal is to have them all done with redirects in the .htaccess file. So I want to have the person who is entering all of this data enter it all through the movable type GUI.

My questions:

  1. Is there is plug-in for movable type that already do开发者_运维问答es this?
  2. If not, is there a good template for creating a movable type that allows one to records in the MySQL database?

Thanks.


This could be done in the standard Entry interface in MT. Just dedicate a blog for these redirects. You could make the EntryTitle the redirect and have the EntryBody be the full URL (or use Custom Fields). Then just create an .htaccess template that loops through all the entries.

<mt:Entries lastn="0">
Redirect /<mt:EntryTitle dirify="-"> <mt:EntryBody>
</mt:Entries>


The way I would do this is to create a custom field for the outside URL.

Then I would populate the .htaccess file with something like:


Redirect / 

In the above coding, I'm looping through the latest 999 entries and I'm checking if the custom field with the tag 'EntryDataMyCustomField' is filled out.

If it is filled out, then I redirect / to the URL from that custom template.

This is like redirecting say:

/234 to whatever URL you may think of, like say: http://en.wikipedia.org/wiki/Main_Page

0

精彩评论

暂无评论...
验证码 换一张
取 消