removing index.php when redirecting to first child

Permalink Browser Info Environment
Just a note to people who might have had the same problem as me.

When redirecting to the first child of a parent page using the Page Auto redirect plugin, the urls contains index.php (pretty urls are activated). But when accessing that same page from the sidebar, it doesn't contain index.php, it's shorter. So you get one page with two different urls. Not quite perfect.

A simple solution to this, is to add the following code to config/site.php
define("URL_REWRITING_ALL", true);


Type: Discussion
Status: New
View Replies:
yogi replied on at Permalink Reply 1 Attachment
The following fix should work without any modifications:

Replace the part beginning at line 68 of page_auto_redirect.php with this one:

# do redirect
            if(is_object($page) && !$page->isError()) {
               # get the page path
               $page_target = $page->getcollectionpath();
               # load the controller just incase
               $pcontroller = Loader::controller($page);
               # redirect
               if(!$page->isExternalLink()) {
                  $nh = Loader::helper('navigation');
                  header('Location: '. ($nh->getLinkToCollection($page)));
               } else {
                  header('Location: '.$page->getCollectionPointerExternalLink());

Attached: My modified page_auto_redirect.php

The author should include something similar.
MrNiceGaius replied on at Permalink Reply
Hey Yogi, thanks! Package updated :)

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.