Rewriteengine on
- Rewriterule!\. (JS|ICO|GIF|JPG|PNG|CSS) $ index.php
- Php_value include_path ". /lib "
- #------------------------------
- httpd.conf
- Rewriteengine on
- Rewritelog "G:\ZendFramework-0.1.2\rewrite.log"
- Rewriterule!\. (js|ico|gif|jpg|png|css|php) $/index.php
Php_value include_path ".; G:\ZendFramework-0.1.2\library "
Copy Code#------------------------------examples in httpd.conf:
- ServerAdmin webmaster@dummy-host.example.com
- Documentroot/var/www/html
- ServerName Linux
- Errorlog Logs/dummy-host.example.com-error_log
- Customlog Logs/dummy-host.example.com-access_log Common
- ServerAdmin webmaster@dummy-host.example.com
- Documentroot/var/www/html/ibm/www
- ServerName IBM
- Errorlog Logs/dummy-host.example.com-error_log
- Customlog Logs/dummy-host.example.com-access_log Common
- Rewriteengine on
- Rewriterule!\. (js|ico|gif|jpg|png|css|php) $/index.php
- Php_value include_path ". /lib "
#这样子后ibm的域名中就可以用zendframework了
Copy CodeReference 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:
- ServerName localhost
- DocumentRoot I:\Projects
- Rewriteengine OFF
- ServerName Happycms
- DocumentRoot I:\Projects\happycms\svn\trunk\src\www
- Rewriteengine on
- Rewritecond%{request_uri}!^.* (\.css|\.js|\.gif|\.png|\.jpg|\.jpeg) $
- Rewriterule ^ (/.*) $/index.php
Copy CodeThe configuration is complete, regardless of whether ZF-based projects can coexist and do not affect each other. |