Peter B.

Making URL's shorter for future but not exisiting entries

Vote 0 Votes

According to several sources, one of them being Google itself, long file names with several hyphens could send a strong spam signal to Google. MT is producing such long file names by using the title of a blog post as basename. I'm aware that I can reduce the length of the basename in the Entry settings but I don't really want to do this since all my existing URL's would be changed as well. I'm also aware that I can change the basename individually each time I post but I'm wondering if there is a way to automatically have shorter basenames only for future URL's.

Reported on Movable Type 4.3

10 Replies

| Add a Reply
  • Hi Peter,

    You could compare the entry date against the current date and if it is older or equal to today, then use the current pattern. If it is newer than today use the new pattern.

    Kind Regards,
    Mihai Bocsaru

    ----------------------------------
    Daily Movable Type Consultant

    Web Development
    Movable Type Consulting
    Six Apart Partner

    http://www.pro-it-service.com/
    ----------------------------------

    Movable Type Demo
    http://www.movabletypedemo.org/
    ----------------------------------

    Open Melody Demo
    http://www.openmelodydemo.org/

  • Thanks, Mihai, but how would I do this?

  • Hi Peter,

    You could do it like this:

    <mt:If tag="EntryDate" format="%m%d%Y" le="11192011">current pattern<mt:Else>new pattern</mt:If>

    Kind Regards,
    Mihai Bocsaru

  • Sorry, my mistake, because the order of the date components should be different in order to get the Less or Equal function to work as we expect it to work for us.

    Use this:

    <mt:If tag="EntryDate" format="%Y%m%d" le="20111119">current pattern<mt:Else>new pattern</mt:If>

    Kind Regards,
    Mihai Bocsaru

  • Thanks again, Mihai but I'm afraid that's too complicated for me. I wouldn't even know where to do this...I'm not too much into the programming thing on MT.

  • Hi Peter,

    Interested to know how you resolved this, as having related issues after an upgrade to MT5.

    Whereas you want to shorten yours, mine have now been shortened but have now have duplicate entries with shortened urls.

    See thread here:

    http://forums.movabletype.org/2011/11/ugly-entry-urls.html

  • You mean you are getting two different entries each time you post something? That's odd.
    I haven't found a solution for this since I'm not good with the programming stuff, so I don't know how to implement Mihai's suggestion. Sure I could limit the number of characters of the basename but then all my existing entries would get new URL's too which is definitely not something I want. When doing this the old entries will stay as well, MT won't delete them. Maybe this is why you are now having two URL's for all your existing entries.

  • Hi

    I'm getting one url when publishing, but it's a new url structure, different to the old. So as my above thread explains, I end up with two urls for one item. Hence duplicates. All I want is to revert back to the old way prior to upgrading to MT5. Something changed, and I like yourself am not able to see immediately what that is, without pointers.

  • Under Preferences - Entry, what did you choose as "Basename Length"? Judging from what I read on the other thread it seems that you have set it to 30 or something.

  • mine is 100. but got someone looking at the install now.

Add a Reply

If you need to share template code, replace all the "<" signs with "&lt;" or use this utility.

Forum Groups

1774 6167

Last Topic: Template modules by Zielun on Feb 16, 2012

86 302

Last Topic: website entries by masoud on Oct 26, 2011

1434 5088

Last Topic: Maintenance announcement by Nick on Feb 17, 2012

695 2912

Last Topic: Insert Image / File Fails by Russ Miller on Feb 10, 2012

84 291

Last Topic: How to have some other characters in entry basename automatically written by Afshin Haghighatnia on Dec 22, 2011

174 740

Last Topic: Captcha images rendering slowly by ScottM on Feb 12, 2012

190 568

Last Topic: Analytics Reporting by michael webster on Feb 5, 2012

48 210

Last Topic: An idea and also a request by Afshin Haghighatnia on Jun 29, 2011

64 246

Last Topic: jQuery in MT 5.1 still at 1.4 - why? by perlmonkey on May 25, 2011

code.sixapart.com

137 478

Last Topic: Getting a thumbnail with xpath by Peter on Mar 13, 2011

222 720

Last Topic: Custom Field for Asset Not Appearing by android on Feb 9, 2012