I am new in ZF2. I have developed my small application in my local computer using virtual host.I want to run this site without virtual host.
My Folder Directory Structure is like this:
-ProjectName
-config
-module
-vendor
- zendframework
-public
- css
- img
- JS
- index.php
Index.php File:
<?php
/**
* This makes our life easier when dealing with paths. Everything is relative
* to the application root now.
*/
chdir(dirname(__DIR__));
// Decline static file requests back to the PHP built-in webserver
if (php_sapi_name() === 'cli-server' && is_file(__DIR__ . parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH))) {
return false;
}
// Setup autoloading
require 'init_autoloader.php';
// Run the application!
Zend\Mvc\Application::init(require 'config/application.config.php')->run();
For access CSS Or Image all time I used $this->basePath() prepend to fetch it.
My application is works fine if I write URL like this:
localhost/projectname/public/modulename
but I doesnt want to use public in url. How can I call my project without "Public" in url.