Yes, base url can be empty. For example, if you have ZF site on your server, which is placed in folder "foo", and main entry point - index.php is in the root of that "foo" folder, then base url will be empty string.
I am using Zend Framework 1.10.2 and the baseUrl view helper always returns an empty string no matter what my original request URL was.
I don't think this is related to ZF-9091, because the suggested solution already exists in the version of Zend/Controller/Request/Http.php that I have.
I don't think my .htaccess could be the problem as the contents are:
I know that not all servers are configured to set the same server variables, so maybe baseUrl doesn't work in all cases. So my question is......Code:RewriteEngine On RewriteBase / RewriteRule !\.(js|ico|gif|jpg|png|css|jar|pdf|doc|wav|mp3)$ index.php
Does anyone know if baseUrl has known issues (meaning I need to find a work-around)? Or is this a bug in my version or the result of a problem that can easily be solved?
Last edited by sawatdee; 04-26-2010 at 01:58 AM. Reason: spelling
www.mysite.com/some_module/some_controller baseUrl still returns an empty string.
i believe baseUrl() gives your the baseUrl not the uri part your in right now.
if you would not have your application index in / of your domain but for instance in /my-test-project/ you can tell zf that this part is not a module/controller etc but its part of the root path. so it will skip that part when checking for route setc
so if you dont set the base path it could return an empty string.
in your config you can set this as following:
resources.frontController.baseUrl = "/subdir"