I am having difficulty with getting custom routes working. I get 404s for anything I try. Right out of the box I notice that `tg-admin` was giving a 404. After working through some tutorials and making my own modules and template I tried again.
The default `/config/custom_routing.php` code doesn't work:
When I paste `tg-admin` I get a 404. But when I paste `trongate_administrators/login` it does work. Same with the tasks module I create.
Related, I wanted to know if I could do something like this to get language and project ID:
That last one is to capture the language and project ID. For example, if I want a url like `https://default.com/en/my-awesome-project/dashboard` that would have urls like:
and example would be something like
Then have the $1 $2 come in as parameters (or the segment() function)
And a child class in `Projects` called `Tags`
Is that a way routes can work? I cannot test because as I said in the first part, I cannot get routes to work at all. But if I put in an error I get a PHP error, naturally.
A special welcome to our newest member, KnoldTot.
Custom Routes not working
#1
3 Oct 2025, 2:23pm UTC
Friday 3rd October 2025, at 2:23pm UTC
Status: Resolved
Edited on Friday 3rd October 2025, at 3:28pm UTC
#2
4 Oct 2025, 6:04am UTC
Saturday 4th October 2025, at 6:04am UTC
G'day PartialShawn,
Thanks for bringing this to our attention. I've had a quick look and from Trongate version 1.4.xxx; the issue appears to stem from how the `attempt_custom_routing` function in `engine/ignition.php` handles URLs when a `BASE_URL` with a path prefix (like `http://localhost/{your_app}/`) is defined. It seems the function isn't correctly stripping this prefix before matching custom routes, causing routes like `'tg-admin'` to fail.
Apply this fix and let me know if it works for you:I haven't tested all your custom routes but they should work.
Cheers,
DaFa
Thanks for bringing this to our attention. I've had a quick look and from Trongate version 1.4.xxx; the issue appears to stem from how the `attempt_custom_routing` function in `engine/ignition.php` handles URLs when a `BASE_URL` with a path prefix (like `http://localhost/{your_app}/`) is defined. It seems the function isn't correctly stripping this prefix before matching custom routes, causing routes like `'tg-admin'` to fail.
Apply this fix and let me know if it works for you:I haven't tested all your custom routes but they should work.
Cheers,
DaFa
Winning Post!
The thread creator has indicated that this post solved the problem or provided the best insight.
Members who post winning responses can earn points for our leaderboard.
Edited on Saturday 4th October 2025, at 2:23pm UTC
This post was liked by; brendan-au
#3
6 Oct 2025, 12:54pm UTC
Monday 6th October 2025, at 12:54pm UTC
Thank you.
I had downloaded the latest release to start the app on the weekend, rather than the GitHub clone I was using for testing and tutorials. It occurred to me yesterday that the new install might work where the GitHub clone didn't, but hadn't had a chance to test that. And sure enough, it does. So that was good enough anyway.
Thank you for the code I can apply to the tutorial area, tho I'm sure I'll soon be able to just pull it. And I appreciate knowing that those rules will work. I had hoped to test them last week.
I was surprised that the latest release has a different configuration than the GitHub repo it's from. I was surprised to see it defaults to using TG Pages in the release, but that seems to have been removed from the repo. Interesting.
Anyway, thanks for your help on both issues.
Thanks.
I had downloaded the latest release to start the app on the weekend, rather than the GitHub clone I was using for testing and tutorials. It occurred to me yesterday that the new install might work where the GitHub clone didn't, but hadn't had a chance to test that. And sure enough, it does. So that was good enough anyway.
Thank you for the code I can apply to the tutorial area, tho I'm sure I'll soon be able to just pull it. And I appreciate knowing that those rules will work. I had hoped to test them last week.
I was surprised that the latest release has a different configuration than the GitHub repo it's from. I was surprised to see it defaults to using TG Pages in the release, but that seems to have been removed from the repo. Interesting.
Anyway, thanks for your help on both issues.
Thanks.
#4
18 Oct 2025, 1:32am UTC
Saturday 18th October 2025, at 1:32am UTC
Thanks DaFa - I spent hours with grok backwards and forwards with htaccess files etc etc trying to figure this out.
Eventually we found this forum post ;)
I'm still learning the framework and php and I don't have the skills to identify core file issues yet.
Cheers!
Brendan
Eventually we found this forum post ;)
I'm still learning the framework and php and I don't have the skills to identify core file issues yet.
Cheers!
Brendan
This post was liked by; DaFa
#6
11 Nov 2025, 1:10pm UTC
Tuesday 11th November 2025, at 1:10pm UTC
Great! Isn't that something that you do you from your end?
I think the idea is that you click on the winning comment and, in doing so, you are effectively marking the whole thread as being 'resolved'.
I haven't looked into this for a long time but I think that's how it's meant to work.
Hope this helps.
DC
I think the idea is that you click on the winning comment and, in doing so, you are effectively marking the whole thread as being 'resolved'.
I haven't looked into this for a long time but I think that's how it's meant to work.
Hope this helps.
DC