ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Invalid Page URI error from brand new 1.6.9 installation

May 29, 2010 5:45pm

Subscribe [4]
  • #1 / May 29, 2010 5:45pm

    ender

    1644 posts

    This question may be related to a resolved thread.

    getting the same “Invalid Page URI” error from a new 1.6.9 installation.  Tried the hack to line 1537 of mod.weblog.php:

    $entry_id = (($TMPL->fetch_param('show_pages') == 'no') ? 'not ' : '').implode('|', array_flip($pages[$PREFS->ini('site_id')]['uris']));

    but that didn’t change anything for me.

    This error appears to be related to having slashes in the Page URI field.  In 1.6.8 and prior versions I could give an entry a Page URI of “/” to indicate that I wanted that entry to load when the homepage was viewed, but that no longer works.  Other Page URIs that don’t work:

    something/
    something/else
    /something
    /something/

    this does work:

    something

    however when you go back to edit the entry it shows as “/something/” and hitting update again gives you the error message.

  • #2 / May 29, 2010 6:13pm

    ender

    1644 posts

    figured this one out.

    line 3858 of cp.publish.php:

    $page_uri = preg_replace("#[^a-zA-Z0-9_\-/\.]+$#i", '', str_replace($PREFS->ini('site_url'), '', $IN->GBL('pages_uri')));

    which works fine assuming the str_replace does what it’s supposed to… however for dev->staging->live release purposes I like to use a “/” for the site_url to make it relative to whatever domain the software is installed on.  When $PREFS->ini(‘site_url’) is “/” however, it removes all the slashes from the pages_uri and kills everything.

    I suppose to make it bulletproof you could validate the site_url to prevent me from doing such things, or silently append the domain if missing when the site_url is loaded into $PREFS->ini, or change this to a permissive regular expression via preg_match so that you don’t need to chop the domain off of $IN->GBL(‘pages_uri’) in the first place since it’s just going to mean you disallow it anyway.

  • #3 / May 30, 2010 9:25am

    Sue Crocker

    26054 posts

    Ty, I’m not certain if this would be considered a bug or a feature. I’m going to move this so one of the devs can make this determination.

  • #4 / Jun 23, 2010 4:46pm

    skinnymonkey

    5 posts

    This error also occurs for my sites in EE2 beta.

  • #5 / Jul 15, 2010 9:57am

    Ingmar

    29245 posts

    Using a single / for the site url is not currently supported, but I see how that would be useful and make for a good Feature Request.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases