ZF2 - router base url

classic Classic list List threaded Threaded
2 messages Options
elk
Reply | Threaded
Open this post in threaded view
|

ZF2 - router base url

elk
This post has NOT been accepted by the mailing list yet.
Hi there. I am struggling with quite simple issue.

I have an old application - let's say http://localhost/ ... which is devided into several modules. I implemented the module "dir" on address http://localhost/dir/ as a new zend 2 application. I made a symlink from http://localhost/dir/ to directory containing the new app, so the new application loaded under that address.

The problem is in zend router. It takes the whole address "localhost/dir" as base url ... so I have a route, that normally matches "/dir", but now "/dir" is matched by route "/". The consequences are assembled urls like "/dir/dir" instead of "/dir" and so on.

Does anybody know setup router base url to "/" (parent), so it would create and match the right urls. I tried

$router->setBaseUrl("/..");

in bootstrap, but it did not work (did not match any route, however creates right url, when used after dispatch)...
Reply | Threaded
Open this post in threaded view
|

Re: ZF2 - router base url

zf2_user
This post has NOT been accepted by the mailing list yet.