Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4321232
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T08:43:15+00:00 2026-05-21T08:43:15+00:00

I have a ZendFramework project that I would like to run inside a subdirectory.

  • 0

I have a ZendFramework project that I would like to run inside a subdirectory.

Currently my document root is at /var/www and the project is at /var/www/project with the various folders (controllers, public, etc.) all within the project directory.

I am trying to make it so that all requests from http://webserver/project/* are being passed to the /var/www/project/public/index.php file. However, trying to use the following code in /var/www/project/.htaccess to pass all requests does not work:

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

There is also an .htaccess file in /var/www/project/public that contains exactly the same code, but when loading the /project URL I am just presented with a directory index of the project contents.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T08:43:16+00:00Added an answer on May 21, 2026 at 8:43 am

    I’d store the project completely separate to the document root, for example /home/user/projects/project.

    Then, simply symlink /var/www/project to /home/user/projects/project/public.

    Provided you use the BaseUrl view helper for any static asset links (JavaScript, images, CSS, etc), it should work just fine.

    Edit: Another suggestion is to separate your public directory from the rest of the application.

    For example, say your project is in /home/user/projects/project, move the contents of your public directory to /var/www/project and edit index.php with the following

    defined('APPLICATION_PATH')
        || define('APPLICATION_PATH', '/home/user/projects/project/application');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple membership project and teh client wishes that urls be simple
I have a closed source project that is built on my open source framework.
I have a project that uses Zend Framework and Zend_Translate . I had to
I have a project that adds elements to an AutoCad drawing. I noticed that
I have my website in /var/www/invent. I have zend-framework in /var/www/invent/library. Basically what i
I am using the Zend Framework. I have a controller named 'UserController' that has
Until now, I have always said that CakePHP is too bloated and slow. I
I am working on an existing project that has two areas that can be
I am trying to add some administration scripts to a Zend Framework project, that
I'm using Doctrine 1.2 as my ORM for a Zend Framework Project. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.