#1
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.
#2

The thread creator has indicated that this post solved the problem or provided the best insight.

Members who post winning responses earn points for our leaderboard.
Points mean prizes!
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
#3
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.

#4
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
#5
We can mark this as solved.
#6
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