Source

DluBaseUrl / README.md

Full commit

DluBaseUrl

THIS MODULE IS NOT NEEDED ANYMORE, JUST USE A CURRENT ZF2 RELEASE!


Introduction

DluBaseUrl is a Zend Framework 2 module used to set the baseUrl in case the application is deployed in a vhost subdirectory and the baseUrl autodetection does not guess the base URL right.

When you need this module?

If you deployed your application into a virtual host subdirectory, i.e. you are accessing the index page something like this:

http://www.server.com/myapp

and you are getting an error in response:

The requested controller could not be mapped to an existing controller class.

then you need this module (provided there is no other error in configuration, routing, etc.).

There is an issue for this bug in the bugtracker:

http://framework.zend.com/issues/browse/ZF2-206

You can use this module to cleanly circumvent the shortcomming until the bug in ZF2 is removed.

More info

You can find more information and discussion of this module on my blog ZF Daily here: ZF2 Gets the baseUrl Wrong

Supported verions

  • Zend Framework 2.0.0beta3

Installation

  1. Go to your project's directory.
  2. Clone this project into your ./vendor/ directory as a DluBaseUrl module:
    git clone https://bitbucket.org/dlu/dlubaseurl.git ./vendor/DluBaseUrl
  3. Enable this module in your ./config/application.config.php.
  4. Copy dluBaseUrl.local.config.php.dist config file to your application's /config/autoload directory
  5. Rename the config file to dluBaseUrl.local.config.php
  6. Edit the config file and enter the correct base URL according to your local deployment as the baseUrl parameter. E.g. if you are accessing your application like this http://www.server.com/myapp, set baseUrl => '/myapp'