0

Does anyone know of a predefined way to increase the number of URI segments ExpressionEngine allows before it throws an error. This is currently set to 10 and I'm sure I could hack the core to achieve this but I thought there may be another way (config setting, extension, etc).

Any suggestions?

  • For those interested; at this stage I've proceeded by modifying /system/expressionengine/core/EE_URL.php Search for "Error: The URL contains too many segments." and then change the value in the IF statement one line above from "9" to whatever you feel works. – Sam Jul 8 '14 at 13:35
2

As far as I know this flatly can't be done without hacking the core and even then it's possible that third-party functionality (and even base functionality) might break. Maybe explain your issue a little more -- there might be a way to accomplish your goal WITHOUT the need for extra segments?

Edited to add:

You can TRY the following, it should work for base EE functionality but I cannot guarantee how it will interact with anything third-party.

In the file /system/expressionenine/core/EE_URI.php, on or around line 133 (depending on the version of EE), find the following:

if (count($segs) > 9)

and change 9 to some other number, like this:

if (count($segs) > 25)

| improve this answer | |
  • Thanks Adrienne, it's just an information flow thing. The client ideally would have liked it so that you could drill down (deep) into a topic which has been setup in a series of nested pages. They've accepted this may not be possible. I did however think the 10 segment restriction would be an arbitrary value and with a bit of luck, someone has messed with this before. No doubt I won't be able to use {segment_53} but for this site, that won't be an issue. – Sam Jul 8 '14 at 12:35
  • Check the above edit and see if it solves your problem; I have ZERO idea how this will interact with anything, it's a really basic answer that addresses only the one place I know a specific numeric check is being done. There might be others; I don't know. – adrienne Jul 8 '14 at 14:54
  • 1
    Thanks Adrienne, rolled this one out last night and seems to do the trick. No issues so far anyway..! – Sam Jul 9 '14 at 11:27
0

Have you tried achieving this with EE structure? As far as I know there isn't a limitation in structure. If there is, please let me know!

| improve this answer | |
  • Yes, the site is using Structure. Structure actually handles it (i.e. it allows you to create pages at that depth) but EE bottoms out once you go to that depth. It produces a white page saying "Error: The URL contains too many segments." – Sam Jul 8 '14 at 12:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.