how can i run cakephp website without app name in url?

I have two app in cakephp2.1.3 vesion, one is admin and second is web, I want to run my website without my app name like without 'web', current website url is 'http://localhost/cakephp2.1.3/web/customers/index' but i need to access using 'http://localhost/cakephp2.1.3/customers/index'.

My current .htaccess is

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule ^admin/$ admin/webroot/ [L]
    RewriteRule ^$ web/webroot/ [L]
    RewriteRule (.*) web/webroot/$1 [L]
</IfModule>

and i have just change outer index.php

define('APP_DIR', 'web');

When i try to access 'http://localhost/cakephp2.1.3/customers/index' it gives error

Error: Cakephp-2.1.3Controller could not be found.
Error: Create the class Cakephp-2.1.3Controller below in file: web\Controller\Cakephp-2.1.3Controller.php

Answers


Assuming you cannot add a new domain and a new VirtualHost, look into apache's mod_alias that can map a url to a (different) filesystem location.

In your case you'll need something like this:

Alias /cakephp2.1.3 /cakephp2.1.3/web/

Need Your Help

Enabling Web Application Support in IntelliJ IDEA 14.1.0

java web-applications intellij-idea

I am trying to enable Web Application Support for a new Java project. I am following the steps mentioned in the following support page.

UWP app as wcf server?

.net wcf uwp core

What I observed is: