views:

63

answers:

1

I just started learning Zend. I managed to get the basic working (using zf create project) in my local web server. Let's just say my project is called square

The only .htaccess that I have: square/public/.htaccess

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

httpd.conf

DocumentRoot "/home/amree/web"

<Directory />
    Options FollowSymLinks
    AllowOverride All
    Order deny,allow
    Deny from all
</Directory>

<Directory "/home/amree/web">
    Options Indexes FollowSymLinks
    AllowOverride all
    Order allow,deny
    Allow from all
</Directory>

NameVirtualHost square
<VirtualHost square>
    DocumentRoot "/home/amree/web/square/public"
    ServerName square
</VirtualHost>

hosts

127.0.0.1               square

I'm running my application on Linux.

From what I've gathered, I can open (loaded without any problems) the site using:

But I can't open it using:

I also have other web applications in the same web server. For example, the meh application can be opened using http://192.168.1.10/meh/ but cannot be opened using http://square/meh

My question is, how can I load my Zend application without getting problems to other applications in the same server? At the moment, I prefer accessing it using my local IP (192.168.1.10). It should be possible to open it from another computer in the same network.

So, in the end I should be able to load the Zend project using

  1. http://192.168.1.10/square
  2. http://192.168.1.10/square/public
  3. http://192.168.1.10/square/public/default/index/index

And I can also open my other meh application using http://192.168.1.10/meh

Thanks in advance.

A: 

You can't indeed access your application using

  • http://square/square/public
    • Using the square domain will match your vhost and /square/public will be rewritten to Zend, whom will try to run Square_PublicController::indexAction()
  • http://192.168.1.10/square/ (got a directory listing)
    • you got a directoy listing (allowed by Options Indexes in <Directory "/home/amree/web">) because your .htaccess is located in http://192.168.1.10/square/public

You have to make a choice between:


Or maybe try an Alias in Apache

Alias /square /square/public
Julien