Page 1 of 1

Retaining older URLs without generating 404s

Posted: Fri May 05, 2006 7:34 am
by wiseleo
This feature will help those who later reorganize their sites as they grow.

With hirerarchical URLs enabled, attempting to access the old pagealiases once they moved to a different location within the menu structure.

For example:

url.com/pagealias.html is now url.com/about/pagealias.html

I would propose intercepting the now invalid url.com/pagealias.html request and redirecting the user to url.com/about/pagealias.html with a 301 code rather than generating 404s and stranding them. Additionally, the default 404 page should be coded with a {sitemap} code by default.

In ideal case, CMS would remember changes to the value of pagealias as well.

Re: Retaining older URLs without generating 404s

Posted: Fri May 05, 2006 9:47 am
by Ted
In theory, this shouldn't happen.  The url parser is supposed to be tossing away everything except for what's after the last slash.  Since page aliases still can't be reused even if they have different parents, I don't do any magic to read the whole url.

I'm kind of surprised that you're getting a 404, to be honest.

Re: Retaining older URLs without generating 404s

Posted: Tue May 09, 2006 1:46 am
by Elijah Lofgren
One solution would be to set this in config.php:

Code: Select all

#If you're using the internal pretty url mechanism or mod_rewrite, would you like to
#show urls in their hierarchy?  (ex. http://www.mysite.com/parent/parent/childpage)
$config['use_hierarchy'] = false;