URLs containing "in" or "to" get renamed?

Permalink
From what I can see, my page URLs "look-in-here" and "go-to-home" are being automatically renamed to "look-here" and "go-home". The words "in" and "to" are being removed from my URLs. Is there a workaround to stop this from happening?

 
Mnkras replied on at Permalink Reply
Mnkras
This is resolved in the next version of c5.

Mike
mkly replied on at Permalink Reply
mkly
This is because of the urlify library. It excludes certain small words by default. concrete5 includes this library and by extension, excludes these words.

As stated this is resolved in the next version, but if you are looking for something in the short term or can't upgrade, there is a HowTo about this.

http://www.concrete5.org/documentation/how-tos/developers/change-fi...

Best Wishes,
Mike
crstf replied on at Permalink Best Answer Reply
Thanks both - I will take a look at the How-To.

[not sure how this got marked as best answer!...]
crstf replied on at Permalink Reply
Unfortunately this failed miserably...

I copied the tutorial exactly but in the two cases where this appears:

// Add 'is' and 'was' to the words to remove
URLify::remove_words = array('is', 'was');

I changed "remove_words" to "add_words" and put my words into the array. I uploaded the two files. BTW Dreamweaver was saying there was something wrong with the line above but I proceeded anyway. I tried to change my page URLs within the Sitemap and the words were still omitted. I tried clearing the cache and got an error when visiting the site root. I tried deleting (site_root)/helpers/text.php and (site_root)/tools/pages/url_slug.php and now when visiting my site root I get:

Warning: require_once(/public_html/helpers/text.php) [function.require-once]: failed to open stream: No such file or directory in /public_html/concrete/core/libraries/loader.php on line 279

Fatal error: require_once() [function.require]: Failed opening required '/public_html/helpers/text.php' (include_path='/public_html/libraries/3rdparty:/public_html/concrete/libraries/3rdparty:.:/usr/local/lib/php') in /public_html/concrete/core/libraries/loader.php on line 279

When restoring text.php to the server I get:
Parse error: syntax error, unexpected '=' in /public_html/helpers/text.php on line 12

When I comment out everything in the file I get:
Fatal error: Class 'TextHelper' not found in /public_html/concrete/core/libraries/loader.php on line 291

When commenting out the line that Dreamweaver warned me about, everything works again. (PHEW - I think I'll back up my database now!!!) Any ideas on why this isn't working?
jasteele12 replied on at Permalink Reply
jasteele12
Unfortunately the URLify::remove_words() function *adds* words to the remove list. There is no corresponding function to *delete* words from the array.

Since this is supposed to be changed in an upcoming version of concrete5 I would suggest to just modify this library directly for your particular site. In this case you won't need to worry about a future core update...

concrete/libraries/3rdparty/urlify.php:85
public static $remove_list = array (
  'a', 'an', 'as', 'at', 'before', 'but', 'by', 'for', 'from',
  'is', 'in', 'into', 'like', 'of', 'off', 'on', 'onto', 'per',
  'since', 'than', 'the', 'this', 'that', 'to', 'up', via',
  'with'
  );


In my opinion many of these are necessary keywords in URL's anyway.

John