Page Paths URL Won't Update Properly

Permalink 1 user found helpful
I have no idea why this is happening. I created a page named Before / After.

I'm not sure what the default path was that it created, but I have since tried to change it many times. For some reason it won't let me keep the word 'before' in the page.

The current path is 'after-photos' and I'm trying to update it to 'before-after-photos'. After I update the path, if I look at the page properties the Canonical URL remains the same (after-photos).

Has anyone ever experienced this before?

Just to be clear, it's only the word 'before' that it's not accepting. If I try to update it to something else, for example 'after-photos-new', it saves the new path correctly without any issues.

Hopefully I can get some insight into what's going on. Thanks!

View Replies: View Best Answer
Remo replied on at Permalink Reply
This is actually easier to explain that one might think.

concrete5 uses a library called urlify to get rid of special characters and certain words in the URL. ü becomes u (should be ue for lots of people by the way), "an" is removed and so is "before".

You can have a quick look at this file:

Search for before and you'll understand where the file is removed.

What can you do in this case:
* You can use the on_page_urlify event, in an add-on you'd have to build, to intercept calls to urlify and call something else. Keep in mind that this is only available in 5.6.1 with this pull request:
* You can override the URLify library in your site and remove the words like "before" you want to keep in the page path.

Hope this helps!
roketto replied on at Permalink Reply
Thanks Remo.

I'm gonna go the route of overriding the URLify library. Appreciate the help!
roketto replied on at Permalink Reply
Hey Remo,

I tried overriding the urlify.php file like so:

1. Created the file [site root]/libraries/3rdparty/urlify.php
2. Pasted the original code into the urlify.php file, deleted 'before' from the remove list

I tried clearing my cache, but I'm still unable to add 'before' the url path.

Have I done this correctly?
Remo replied on at Permalink Best Answer Reply
Works fine for me! Depending on the version you're using, clearing the cache might not be enough. Try to disable the override cache or maybe all caches just to see if it makes any difference.
roketto replied on at Permalink Reply
I think maybe I'm doing this wrong...

Here's the code I edited:

    * List of words to remove from URLs.
   public static $remove_list = array (
      'a', 'an', 'as', 'at', 'but', 'by', 'for', 'from',
      'is', 'in', 'into', 'like', 'of', 'off', 'on', 'onto', 'per',
      'since', 'than', 'the', 'this', 'that', 'to', 'up', 'via',

As you can see I'm simply removed the word 'before' so that it is no longer listed in the urlify.php file. Still having the same troubles. Just can't get 'before' to be a part of my pages path, even after clearing my cache.

Any ideas?
hamsterbacke82 replied on at Permalink Reply
Why would you even want to edit code for this? 5.6.1 introduced a dashboard interface for adding or removing words from that list
Remo replied on at Permalink Reply
Because this isn't multi lingual. Some people have complex multilanguage sites where these rules are different per language.
roketto replied on at Permalink Reply
I didn't know that... I would have used this feature had I been aware.

Where through the dashboard can I find this?
Remo replied on at Permalink Reply
roketto replied on at Permalink Reply
I got it to work! Overrides caching was turned off, but I still had basic caching on. I turned all caching off and cleared my cache. Now it seemed to work!

Cheers :)