Fork me on GitHub

Short URL with file type (Type of URLs generated)  Bottom

  • I've installed the mod_rewrite module in my apache2 webserver. After that i have copied the .htaccess file from /docs/shorturls.file.htaccess (mv shorturls.file.htaccess .htaccess) to the root directory. Now i'm testing the short urls in the postnuke settings. The directory type (type of URLs generated) runs very well but i have problems with the file type. The links are translated but when i klick on a link the site isn't found. Can anybody help?

    Thank's a lot




    edited by: jayr1979, Aug 30, 2007 - 05:37 PM
  • Did you enable shorturls within PostNuke?

    • Login
      ../user.php
    • Go to admin
      ../admin.php
    • Settings
    • Xanthia
    • Configuration
    • enable Short-urls


    --
    David Pahl
    Zikula Support Team
  • I have enable short-urls in the backend with (System -> Settings -> Short-URLs). I don't have Settings -> Xanthia -> Configuration... ? I'm testing the Postnuke Version 0.8.0.0 RC1. The "directory mode" works very well, but not the alternative "file mode" with *.html.
  • Are you sure you have the correct .htaccess in place? If the correct htaccess is not present you will get 404 errors.

    --
    itbegins.co.uk - Zikula Consulting

    birtwistle.me.uk - Personal Blog


    Please read the Support Guide
  • Hi Jan!
    Welcome to the PostNuke Community!

    There are different htaccess for both types of urls.
    If you choice the directory type you must copy the htaccess named 'shorturls.directory.htaccess', otherwise if you want a file type urls, you must use the 'shorturls.file.htaccess' one.
    The process isn't all automatic.

    What do you think about the 0.8 features? look'n feel?

    Welcome again and Enjoy PostNuke!

    --
    - Mateo T. -
    Mis principios... son mis fines
  • Hi Hammerhead, hi nestormateo!

    I have copied the content of /docs/shorturls.file.htaccess in the /.htaccess file and it contains now:

    Code

    # PostNuke Application Framework
    #
    # @copyright (c) 2001, PostNuke Development Team
    # @link http://www.postnuke.com
    # @version $Id: $
    # @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
    #
    # Based upon the .htaccess of MD-Pro, written by
    # LongiTEKK.com NETWORK Admin - chtekk@longitekk.com
    # MaxDev Devel - chtekk@maxdev.com
    #
    # ----------------------------------------------------------------------
    # Place this file in your Postnuke root directory, alongside the main
    # index.php file
    # The "Options FollowSymLinks" line may be deleted, since on certain
    # hosts it causes a config error!
    # ----------------------------------------------------------------------

    # security options
    php_flag register_globals off
    php_flag magic_quotes_gpc off

    Options FollowSymLinks

    RewriteEngine On

    # ENG
    # This option is for use in Virtual Hosts or .htaccess files to inherit rewrite rules in the main section,
    # so if you have your own server you don't have to copy the rules into every Virtual Host you run.
    # Will cause an error if placed in the main httpd.conf section, as there's nothing to inherit.

    # RewriteOptions 'inherit'

    # Exclude certain directories
    RewriteRule ^modules/.*$ - [PT]
    RewriteRule ^themes/.*$ - [PT]
    RewriteRule ^javascript/.*$ - [PT]

    # Basic entry point rules
    RewriteRule ^index\.p?html?$ index.php [L,NC,NS]
    RewriteRule ^user\.p?html?$ user.php [L,NC,NS]

    # Theme changing
    RewriteRule ^changetheme-([^-]+)\.p?html?$ index.php?newtheme= [L,NC,NS]
    RewriteRule ^previewtheme-([^-]+)\.p?html?$ index.php?theme= [L,NC,NS]

    # General rules for modules with index.php?module=... / Regole generali per moduli con 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]

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

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


    and i get a 404 Not Found Error.

    Thank's a lot!

    Thanks for nice reception! @nestormateo

    In the last year i have to settle for a content management systen. The alternatives at this time were joomla and typo3. Using postnuke was the descision, because it's easy to use and it's easy to write extensions.
    Congratulation for Postnuke!

  • Strange,
    This must not happen when you have the correct file.htaccess and the settings with File-type and 'HTML' extension for file-based URLs! You didn't change the extension right? Be sure of this.

    If you want to change the file extension from HTML to htm, you must change all the .html in the htaccess to the new extension.

    Also you can delete all the compiled (and possibly cached templates):
    Layout ->
    pnRender Engine ->
    Delete compiled templates
    Delete cached pages
    Xanthi a theme engine ->
    Settings ->
    Delete compiled templates
    Delete cached templates

    and try again,
    Tell us what happen.
    Good luck and good choice icon_wink

    Happy PostNuking!

    --
    - Mateo T. -
    Mis principios... son mis fines
  • I have this same problem, but worse. short urls for file give me 404s and also the directory ones unless I DON'T strip the entry point. Then it works.
  • You must have a .htaccess in place to strip the entry point - if you're getting 404s the correct .htaccess isn't there.

    --
    itbegins.co.uk - Zikula Consulting

    birtwistle.me.uk - Personal Blog


    Please read the Support Guide

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