How to add prefix to all urls


#1

I want to add a prefix to all urls ?
thanks


#2

You cloud use
CakePHP routing

But if you want to add a prefix to all routing paths than it may be more convenient to put CakePHP in a subfolder


#3

In general, it seems that overriding Helper::url might be the solution.


#4

Using a subfolder is the thing not to do . How are you going to deal with sessions ? cachue, etc .


#5

I don’t no your use case,
As for using a sub-folder you just don’t

All cakePHP routing is done in '.\config\routes.php '
I advice tor read https://book.cakephp.org/3.0/en/development/routing.html#prefix-routing
and try it out


#6

Hi, Yes this is what I used. Some configuration in conjunction with routes.php thanks