Fork me on GitHub

Short URLs Are Broken in 1.2.4  Bottom

Go to page 1 - 2 [+1]:

  • After months of preparation and a 20 hour marathon I've upgraded my largest site from .764 to 1.2.4 only to discover that the file based urls I've used for many years do not work.

    This is an extremely serious problem for the site, is killing traffic and search engine position as I type because now every URL in thousands of pages has been changed, breaking countless bookmarks and search engine result links.

    I'm desperately hoping that someone has already fixed this and it just hasn't made into this ticket, which is over a month old (wish i had seen it before hand)
    http://code.zikula.org/core/ticket/2520

    --
    Damon
    Catamaran Sailing at TheBeachcats.com
  • I am not a ShortURLs expert, but I think there is some confusion here. The old ShortURLs implementation was based on explicit rewrite rules which were listed in .htaccess. You will see that your old .htaccess has many rules spanning several pages while the new one only has a few commands.

    The new ShortURL implementation is based on a few generic rules with the ShortURL matching/decoding being handled by the Zikula theme code (in conjunction with optional module code).

    So, to enable ShortURLs the way you had them in PN 0.764, do the following:
    1) Turn Off Short URLs in your Zikula config (since you don't want the Zikula-powered solution)
    2) Place the .htaccess from your 0.764 install into your Zikula root.

    In theory this should work. But maybe I've gotten it all wrong; like I said, I don't use short-URLs much.

    Greetings
    Robert
  • What is not working? Are your long URLs not converted to short URLs by the output filter? Are your short URLs not resolving to long URLs?
  • rgasch

    I am not a ShortURLs expert, but I think there is some confusion here.

    I wouldn't be surprised, I've been functioning on very little sleep the last few days. icon_biggrin

    rgasch

    So, to enable ShortURLs the way you had them in PN 0.764, do the following:
    1) Turn Off Short URLs in your Zikula config (since you don't want the Zikula-powered solution)
    2) Place the .htaccess from your 0.764 install into your Zikula root.


    I was really hoping that would work, because the ideal would be for the new 1.2.4 version of the site to have the exact same urls as the old, but that doesn't work at all.

    dits

    What is not working? Are your long URLs not converted to short URLs by the output filter? Are your short URLs not resolving to long URLs?


    What happens is that when you use for instance {Web_Liinks} in a menu then /index.php?module=Links is converted to /module-Links.html (where the module URL name is Links) but that link is a 404 not found. It's the same on all modules.

    One odd exception that might help track down the cause is that I made a link for a Downloads category using {Downloads:sublevel&cid=2&sortby=date:}the long version produced is
    /index.php?module=Downloads&func=sublevel&cid=2&sortby=date
    and short version is
    /module-Downloads-sublevel-cid-2-sortby-date.html
    and they both work.
    but
    /module-Downloads.html is 404

    --
    Damon
    Catamaran Sailing at TheBeachcats.com
  • Related problem. After realizing that all my navigation was broken and that even if they worked, file based short urls in Zikula 1.2.4 are not going to be the same as in PN .764, I tried the directory based urls.

    I've got a dozen other Zikula sites and always use the directory based urls since I like the style better for seo and those urls don't break down when emailed with only / as seperators.

    Problem is that now all the {Web_Links} type links in menus produce correct working links like
    /Links
    and that Download category link I mention in the previous post becomes
    /Downloads/sublevel/cid/2/sortby/date which works fine. (wish it had the name of category instead of cid)

    But a big problem, I'm using News 2.6.2 as my start page module and all the news title links go to the same URL just
    /news
    even links produced by the news archive and the "read more" link show only /news instead of linking to a particular article.

    Is that a bug with the 2.6.2 News or with short urls or with something I've screwed up?

    --
    Damon
    Catamaran Sailing at TheBeachcats.com
  • Look at your .htaccess
    On line 58 where is a # before, its outcommented why ever???
    delete the # and it will work.

    Regards Petzi winke

    --
    Petzi-Juist :: ... welcome to my digital world ...
  • Petzi-Juist

    Look at your .htaccess
    On line 58 where is a # before, its outcommented why ever???
    delete the # and it will work.


    Thanks Petzi, but the .htaccess I'm using right now (for site in my sig) only has 28 lines, it's the file straight from the /docs menu shorturls.directory.htaccess renamed to .htaccess

    The only addition to it is
    suPHP_ConfigPath /home/example/www
    so that the php.ini file applies to the whole site.

    Code

    # Zikula Application Framework
    # ----------------------------------------------------------------------
    # Place this file in your Zikula root directory, alongside the main
    # index.php file
    # ----------------------------------------------------------------------

    # security options if they work in your environment.  If you get a 500 error then they wont.
    # These settings are best turned off in php.ini and will be on modern hosting environemnts.
    #php_flag register_globals off
    #php_flag magic_quotes_gpc off

    suPHP_ConfigPath /home/example/www

    # turn the rewriting engine on
    RewriteEngine on

    # Enable RewriteBase if Zikula is installed to a sub-directory
    # RewriteBase /your/path/to/Zikula

    # handle the favicon to prevent a full request to our engine
    RewriteRule ^(.*)favicon.ico - [L]

    # rewrite any unknown directories and files
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f

    # re-add index.php back into the url
    RewriteRule ^(.+) index.php? [L]


    --
    Damon
    Catamaran Sailing at TheBeachcats.com
  • Like Petzi suggested, if you uncomment line 58, shorturls should work fine.
    You can find the correct file here.
    This is of course if you decide to use file-based shorturls.



    Edited by tfotis on Oct 19, 2010 - 09:02 PM.
  • What I write was for shorturls.file.htaccess and your first problem

    Regards Petzi winke

    --
    Petzi-Juist :: ... welcome to my digital world ...
  • damon


    What happens is that when you use for instance {Web_Liinks} in a menu then /index.php?module=Links is converted to /module-Links.html (where the module URL name is Links) but that link is a 404 not found. It's the same on all modules.


    In other words: your file based short URLs are working, they are just not redirected back to the proper long URLs. I suggest to restore your .htaccess file from your original .764 site. That should work.
  • @ it should work ?! but it is overloaded with to many rules.
    Make the change I write and it will work too.

    Regards Petzi winke

    --
    Petzi-Juist :: ... welcome to my digital world ...
  • Petzi-Juist

    What I write was for shorturls.file.htaccess and your first problem
    Regards Petzi winke

    Oh, ok, but here's the thing, I didn't change that file. The commented line was there in the original shorturls.file.htaccess file in a fresh Zikula 1.2.4 download.

    quoting the original shorturls.file.htaccess beginning with line 57

    Code

    # General rules for modules with index.php?module=...
    #RewriteRule ^module-([^-]+)\.p?html?$ index.php?module=&func=main [L,NC,NS]
    RewriteRule ^module-([^-]+)-([^-]+)\.p?html?$ index.php?module=&func= [L,NC,NS]
    RewriteRule ^module-([^-]+)-([^-]+)-([^-]+)-([^-]+)\.p?html?$ index.php?module=&func=&= [L,NC,NS]
    RewriteRule ^module-([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+)\.p?html?$ index.php?module=&func=&=&= [L,NC,NS]
    RewriteRule ^module-([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+)\.p?html?$ index.php?module=&func=&=&=&= [L,NC,NS]


    Anyway I've decided that I might as well make the change to directory based urls that I prefer since even with file urls most links are going to change. Traffic is going to take a big hit but longterm the better urls should help the site. I just hope there is stability in this going forward to Zikula 2.0 or I will be on 1.2x for a long time.

    --
    Damon
    Catamaran Sailing at TheBeachcats.com
  • dits

    . I suggest to restore your .htaccess file from your original .764 site. That should work.


    The .htaccess from .764 doesn't produce correct URL's in 1.2.4 with either short urls on or off in settings. Most urls just stay long and others get forms that don't get converted back.

    --
    Damon
    Catamaran Sailing at TheBeachcats.com
  • damon

    But a big problem, I'm using News 2.6.2 as my start page module and all the news title links go to the same URL just
    /news
    even links produced by the news archive and the "read more" link show only /news instead of linking to a particular article.


    Hijacking my own thread:
    So I'm giving up on file urls and switching to directory based, but still have the quoted problem.

    --
    Damon
    Catamaran Sailing at TheBeachcats.com
  • damon

    dits

    . I suggest to restore your .htaccess file from your original .764 site. That should work.


    The .htaccess from .764 doesn't produce correct URL's in 1.2.4 with either short urls on or off in settings. Most urls just stay long and others get forms that don't get converted back.


    Assuming you are using file based URLs:

    In Postnuke .764 long URLs are converted to short URLs upon display by the regular expression in modules/Xanthia/plugins/outputfilter.shorturls.php. Upon fetching these short URLs from the server they are converted back to long URLs using the rewrite rules defined in the .htaccess file in your root.

    In Zikula 1.2.4 long URLs are converted to short URLs in Xanthia upon display by the regular expression in system/pnRender/plugins/outputfilter.shorturls.php. Upon fetching these short URLs from the server they are converted back to long URLs using the rewrite rules defined in the .htaccess file in your root.

    If you make sure that the rules in the outputfilter match the rules in the .htaccess file things will work.



    Edited by dits on Oct 19, 2010 - 09:47 PM.

Go to page 1 - 2 [+1]:

This list is based on users active over the last 60 minutes.