The wording of/http.conf in the htaccess of ZF.

Source: Internet
Author: User
    1. Rewriteengine on

    2. Rewriterule!\. (JS|ICO|GIF|JPG|PNG|CSS) $ index.php
    3. Php_value include_path ". /lib "
    4. #------------------------------
    5. httpd.conf
    6. Rewriteengine on
    7. Rewritelog "G:\ZendFramework-0.1.2\rewrite.log"
    8. Rewriterule!\. (js|ico|gif|jpg|png|css|php) $/index.php

    9. Php_value include_path ".; G:\ZendFramework-0.1.2\library "

Copy Code

#------------------------------examples in httpd.conf:

    1. ServerAdmin webmaster@dummy-host.example.com
    2. Documentroot/var/www/html
    3. ServerName Linux
    4. Errorlog Logs/dummy-host.example.com-error_log
    5. Customlog Logs/dummy-host.example.com-access_log Common
    6. ServerAdmin webmaster@dummy-host.example.com
    7. Documentroot/var/www/html/ibm/www
    8. ServerName IBM
    9. Errorlog Logs/dummy-host.example.com-error_log
    10. Customlog Logs/dummy-host.example.com-access_log Common
    11. Rewriteengine on
    12. Rewriterule!\. (js|ico|gif|jpg|png|css|php) $/index.php
    13. Php_value include_path ". /lib "

    14. #这样子后ibm的域名中就可以用zendframework了

Copy Code

Reference Tutorials

How to install ZF on hosts with multiple PHP programs

This is my phpeye in our group on the post, suddenly thought may be useful to everyone turned over hehe.

If you already have a lot of PHP projects on your machine, like me, most of them are not based on ZF. I usually create dozens of directories in the Web root directory, one for each project. It turned out that our access to the project might have been accessed through HTTP://LOCALHOST/PROJECT1,HTTP://LOCALHOST/PROJECT2. In general, projects do not affect each other, because our programs generally do not strictly demand the path of the file. As long as the relative path pair is OK.

But now we need to install ZF,ZF requirements index.php located in the root directory of the site. So how to make the original program can still access the normal, and based on the ZF program we can also access? For example, I have built a project that is happycms, so I would like to enter HTTP://HAPPYCMS to access my ZF-based HAPPYCMS project, while other projects are still accessed through Http://localhost/project1.

My approach:

1. Edit the Hosts file under the C:\windows\system32\drivers\etc directory under 127.0.0.1 localhost by adding: 127.0.0.1 happycms

2, edit C:\Program files\apachegroup\apache2\conf directory httpd.conf add namevirtualhost 127.0.0.1 at the end of the file add:

    1. ServerName localhost
    2. DocumentRoot I:\Projects
    3. Rewriteengine OFF
    4. ServerName Happycms
    5. DocumentRoot I:\Projects\happycms\svn\trunk\src\www
    6. Rewriteengine on
    7. Rewritecond%{request_uri}!^.* (\.css|\.js|\.gif|\.png|\.jpg|\.jpeg) $
    8. Rewriterule ^ (/.*) $/index.php
Copy Code

The configuration is complete, regardless of whether ZF-based projects can coexist and do not affect each other.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.