Help! Page Path URLs being trimmed.
Permalink
I am do parallel development for a website I manage - and today I'm in the process of shutting of the old content and turning on the new.
The ability to add page paths to C5 pages is AWESOME! - but I have a problem.
Some of my extremely long URLs (from the non-C5 site) are being trimmed when I insert them as additional page path URLs to the new C5 pages.
I need to find out how I can remove or increase the maximum length for page urls.
Here's a typical page URL I'm adding to a C5 page:
/college_services/financial_aid/scholarship_calculator
It is being trimmed down to:
/college_services/financial_aid/scholarship_calc
The end result is a 404 error. So what file can I edit to get C5 to stop shortening my page path URLs (I just need them to be a little bit longer)?
The ability to add page paths to C5 pages is AWESOME! - but I have a problem.
Some of my extremely long URLs (from the non-C5 site) are being trimmed when I insert them as additional page path URLs to the new C5 pages.
I need to find out how I can remove or increase the maximum length for page urls.
Here's a typical page URL I'm adding to a C5 page:
/college_services/financial_aid/scholarship_calculator
It is being trimmed down to:
/college_services/financial_aid/scholarship_calc
The end result is a 404 error. So what file can I edit to get C5 to stop shortening my page path URLs (I just need them to be a little bit longer)?
I have the same problem. I also have so urls that contain "spaces" and C5 converts the url to "_" underscores.
try typing in %20 instead of space?
not sure what to do about the long url though, but there's an article on c5 mix on where to change the url generated using - instead of _, that might get you started.
just remember what you need to change in the core files for every version update
not sure what to do about the long url though, but there's an article on c5 mix on where to change the url generated using - instead of _, that might get you started.
just remember what you need to change in the core files for every version update
Here's the article kutis was speaking about:http://c5mix.com/tutorials/use-hyphens-instead-of-underscores-in-co...
Didn't see anything in the files they mention that would shorten Page URLs though :(
Didn't see anything in the files they mention that would shorten Page URLs though :(
I want to post some more on this issue, because it seems to be a legitimate bug, that I can replicate over and over.
Here's what I'm doing, and what Concrete is doing.
I have a page, created in concrete5 that I am assigning additional page page URLs by using the Properties window in the Dashboard.
I enter "/college_services/financial_aid/merit_scholarships" as an additional page URL.
Click "Save"
Immediately go back into the properties of the same page and the Additional URL has been shortened to: "/college_services/financial_aid/merit_scholarshi"
---
I can edit the PagePath URL directly in the database, and it will display correctly in the C5 properties for that specific page (all the old links also work correctly).
But as soon as I hit "Save" on that properties overlay, the database will be overwritten with the shortened Page Path URL.
---
So something in C5 is trimming these additional page path URLs. These URLs are not excessively long, in fact I have other C5 created URLs that are much longer.
I have no idea why C5 is shortening these URLs, and any workaround I perform with directly editing the database will be overwritten as soon as someone pokes around with the page's properties and hits save, even if they didn't change anything.
Here's what I'm doing, and what Concrete is doing.
I have a page, created in concrete5 that I am assigning additional page page URLs by using the Properties window in the Dashboard.
I enter "/college_services/financial_aid/merit_scholarships" as an additional page URL.
Click "Save"
Immediately go back into the properties of the same page and the Additional URL has been shortened to: "/college_services/financial_aid/merit_scholarshi"
---
I can edit the PagePath URL directly in the database, and it will display correctly in the C5 properties for that specific page (all the old links also work correctly).
But as soon as I hit "Save" on that properties overlay, the database will be overwritten with the shortened Page Path URL.
---
So something in C5 is trimming these additional page path URLs. These URLs are not excessively long, in fact I have other C5 created URLs that are much longer.
I have no idea why C5 is shortening these URLs, and any workaround I perform with directly editing the database will be overwritten as soon as someone pokes around with the page's properties and hits save, even if they didn't change anything.
This will be fixed in 5.3.2.1.
We have a function in the backend that is supposed to trim page handles, prior to putting them into a URL. This trimmed the page handle down to 48 characters.
Unfortunately, this function is now being run on the additional page handles in their entirety, truncating the entire URL down to 48 characters. This is obviously unacceptable.
The 48 character limit isn't really necessary any longer, so I'm removing it from the core. To do this, open concrete/helpers/text.php, and change
to
This should fix your errors. We will be working on some other areas of SEO concern (with the separators, etc...) but this should fix this error in the meantime.
We have a function in the backend that is supposed to trim page handles, prior to putting them into a URL. This trimmed the page handle down to 48 characters.
Unfortunately, this function is now being run on the additional page handles in their entirety, truncating the entire URL down to 48 characters. This is obviously unacceptable.
The 48 character limit isn't really necessary any longer, so I'm removing it from the core. To do this, open concrete/helpers/text.php, and change
if (function_exists('mb_substr')) { $handle = mb_strtolower(mb_substr($handle, 0, 48, APP_CHARSET), APP_CHARSET); } else { $handle = strtolower(substr($handle, 0, 48)); }
to
if (function_exists('mb_substr')) { $handle = mb_strtolower($handle, APP_CHARSET); } else { $handle = strtolower($handle); }
This should fix your errors. We will be working on some other areas of SEO concern (with the separators, etc...) but this should fix this error in the meantime.
Thanks so much for your quick response!
You kept many 404's from appearing!
You kept many 404's from appearing!