Fork me on GitHub

pNWikka Short URL like on this Site  Bottom

  • Hi

    I have played around with pnWikka after checking it out from SVN (any reason there
    is no offical package?).

    It works like a charm but i noticed on a fresh 0.764 installation that the links in the
    Wiki are not "short URLified".

    I compared it with the entries here on the side and i noticed here it works.

    Can the person who fixed it please give a hint how to enable it?

    Thanks
    MT
  • Hm, i have to answer my own thread...

    Insert this 2 parts in outputfilter.shorturls.php

    Code

    $prefix . 'index.php\?module=pnWikka"|',
      $prefix . 'index.php\?module=pnWikka&(?:amp;)?([\w\d\.\:\_\/]+)"|',
      $prefix . 'index.php\?module=pnWikka&(?:amp;)?([\w\d\.\:\_\/]+)[#]([\w\d]*)"|',
      $prefix . 'index.php\?module=pnWikka&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)"|',
      $prefix . 'index.php\?module=pnWikka&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)[#]([\w\d]*)"|',
      $prefix . 'index.php\?module=pnWikka&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)&(?:amp;)?([\w\d\.\:\_\/]+)"|',
      $prefix . 'index.php\?module=pnWikka&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)&(?:amp;)?([\w\d\.\:\_\/]+)[#]([\w\d]*)"|',
      $prefix . 'index.php\?module=pnWikka&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)"|',
      $prefix . 'index.php\?module=pnWikka&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)[#]([\w\d]*)"|',
      $prefix . 'index.php\?module=pnWikka&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)&(?:amp;)?([\w\d\.\:\_\/]+)"|',
      $prefix . 'index.php\?module=pnWikka&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)&(?:amp;)?([\w\d\.\:\_\/]+)[#]([\w\d]*)"|',
      $prefix . 'index.php\?module=pnWikka&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)"|',
      $prefix . 'index.php\?module=pnWikka&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)[#]([\w\d]*)"|',
      $prefix . 'index.php\?module=pnWikka&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)&(?:amp;)?([\w\d\.\:\_\/]+)"|',
      $prefix . 'index.php\?module=pnWikka&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)&(?:amp;)?([\w\d\.\:\_\/]+)[#]([\w\d]*)"|',
      $prefix . 'index.php\?module=pnWikka&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)"|',
      $prefix . 'index.php\?module=pnWikka&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)&(?:amp;)?([\w\d\.\:\_\/]+)=([\w\d\.\:\_\/]+)[#]([\w\d]*)"|',

    //and the 2nd part:

      '"'.$base_url.'wiki.'.$extension.'"',
      '"'.$base_url.'wiki-.'.$extension.'"',
      '"'.$base_url.'wiki-.'.$extension.'#"',
      '"'.$base_url.'wiki--.'.$extension.'"',
      '"'.$base_url.'wiki--.'.$extension.'#"',
      '"'.$base_url.'wiki---.'.$extension.'"',
      '"'.$base_url.'wiki---.'.$extension.'#4"',
      '"'.$base_url.'wiki----.'.$extension.'"',
      '"'.$base_url.'wiki----.'.$extension.'#"',
      '"'.$base_url.'wiki-----.'.$extension.'"',
      '"'.$base_url.'wiki-----.'.$extension.'#"',
      '"'.$base_url.'wiki------.'.$extension.'"',
      '"'.$base_url.'wiki------.'.$extension.'#"',
      '"'.$base_url.'wiki-------.'.$extension.'"',
      '"'.$base_url.'wiki-------.'.$extension.'#"',
      '"'.$base_url.'wiki--------.'.$extension.'"',
      '"'.$base_url.'wiki--------.'.$extension.'#"',


    in .htaccess insert

    Code

    # General rule Wikka
    RewriteRule ^wiki\.htm$ index.php?module=pnWikka [L]
    RewriteRule ^wiki-(?:([^-]+)-([^-]+))?(? <img src="http://community.zikula.org/images/smilies/icon_frown.gif" alt="icon_frown" /> [^-]+)-([^-]+))?(? <img src="http://community.zikula.org/images/smilies/icon_frown.gif" alt="icon_frown" /> [^-]+)-([^-]+))?(? <img src="http://community.zikula.org/images/smilies/icon_frown.gif" alt="icon_frown" /> [^-]+)-([^-]+))?\.htm$ index.php?module=pnWikka&$1=$2&$3=$4&$5=$6&$7=$8 [L]



    Thats all
  • michtoen

    I compared it with the entries here on the side and i noticed here it works.

    Can the person who fixed it please give a hint how to enable it?

    Thanks
    MT


    I would like to know how about short URL's for pnWikka also. And it looks like SVN is the only source for this?
    Thanks,



    --
    Damon
    Catamaran Sailing at TheBeachcats.com
  • If your main .htaccess file contains those lines, short urls should work fine for most modules including pnWikka:

    Code

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

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

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

    # General rules for modules with index.php?name=...&file=...
    RewriteRule ^([^-]+)\+([^-]+)\.html$ index.php?name=&req= [L,NC,NS]
    RewriteRule ^([^-]+)\.html$ index.php?name= [L,NC,NS]
    RewriteRule ^([^-]+)-([^-]+)\.html$ index.php?name=&file= [L,NC,NS]
    RewriteRule ^([^-]+)-([^-]+)-([^-]+)-([^-]+)\.html$ index.php?name=&file=&= [L,NC,NS]
    RewriteRule ^([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+)\.html$ index.php?name=&file=&=&= [L,NC,NS]
    RewriteRule ^([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+)-([^-]+)\.html$ index.php?name=&file=&=&=&= [L,NC,NS]

    Greetings,
    Chris

    --
    an operating system must operate
    development is life
    my repo
  • 0 users

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