Sarang
Sarang

Reputation: 784

Zend framework 2 multiple module url routing issue

Am facing the issue when I have two or three module in my framework like

The way I can access the above module using URL is as follows

But I want access the module in the following way

I have checked on the following links but this dose not worked for me

Having trouble with URI routing for modules in Zend Framework
Routing in Zend Framework 2
Zend framework 2 module name routing issue
Zend Framework 2 - Multiple modules by URL
Zend Framework 2 routing issue
404 error, Zend Framework 2 The requested URL could not be matched by routing

For removing the public I have managed by creating the Index.php at the root level of the project with the following code

<?php 
    define('RUNNING_FROM_ROOT', true);
    include 'public/index.php';

Please help me if anyone has faced similar issue

Upvotes: 1

Views: 299

Answers (2)

Sarang
Sarang

Reputation: 784

Solved the Issue

  • Removed both the index.php and .htaccess file from the root level
  • set the virtual host from the zend document
  • Followed the answer given on stackoverflow

Configuration am using

  • Ubuntu 14.04
  • PHP 5.5.9
  • apache2

Upvotes: 0

Wilt
Wilt

Reputation: 44326

You should not add your own index.php at root level. You should delete this file again. Your issue is that you should serve the application from your /public folder folder.

It seems like you are currently serving from the ZF2 application root folder. The recommended solution is to change your server settings to serve from /public instead. In Apache you can do this for example using your virual host config. It has a DocumentRoot param.

Otherwise check the answer to an alternative solution here.

Upvotes: 1

Related Questions