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 6115451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:05:34+00:00 2026-05-23T15:05:34+00:00

I have several small projects I want to host on single virtual host using

  • 0

I have several small projects I want to host on single virtual host using Zend Framework. The structure is:

    apps/
        testapp1/
          application/
          index.php,
        testapp2/
          application/
          index.php

Document root in virtual host looks like: DocumentRoot /var/www/apps/

I need univeral mod_rewrite rule which will transform URLs like /apps/testapp1/xxx into /apps/testapp1/index.php.

Any help will be greatly appreciated as I am trying to resolve that for several hours. Thank You.

  • 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-23T15:05:35+00:00Added an answer on May 23, 2026 at 3:05 pm
    1. If your DocumentRoot for website is /var/www/apps/, then I guess URLs would be http://www.example.com/testapp1/ajax instead of http://www.example.com/apps/testapp1/ajax. If so — then you need to remove apps/ part from these rules.

    2. These rules need to be placed in your .htaccess into website root folder.

    3. If you already have some rules there then these new rules needs to be placed in correct place as order of rules matters.

    4. You may need to add RewriteEngine On line there if you do not have such yet.

    This rule will rewrite /apps/testapp1/ajax into /apps/testapp1/index.php, no other URLs will be affected:

    RewriteRule ^apps/testapp1/ajax$ /apps/testapp1/index.php [NC,QSA,L]
    

    This rule will rewrite ALL URLs that end with /ajax into /index.php (e.g. /apps/testapp1/ajax => /apps/testapp1/index.php as well as /apps/testapp2/ajax => /apps/testapp2/index.php):

    RewriteRule ^(.+)/ajax$ /$1/index.php [NC,QSA,L]
    

    UPDATE:

    This “universal” rule will rewrite /apps/testapp1/xxx into /apps/testapp1/index.php as well as /apps/testapp2/something => /apps/testapp2/index.php:

    RewriteRule ^(.+)/([^/\.]+)$ /$1/index.php [NC,QSA,L]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several small open-source projects that I wrote. All my attempts to find
I have a small application to convert several file formats, with a main windows
I have several small Visual Studio Projects (C++). And many of these projects have
I have been making several projects to compile small SDL code tutorials from a
Suppose I have several small test cases. Easy enough to setup and easy enough
I have several RequiredFieldValidators in an ASP.NET 1.1 web application that are firing on
I have a small web application that I am building. Primarily to improve my
I want to use several standard third-party libs (e.g. Apache's log4j) for a small
I have created several small applications that use my own DLL. The problem is,
I'm working on a project in Symfony2 and I have several small pieces of

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.