使用zend配置问题

0 0 372

如果你开发php程序用了zend框架,或者其他框架(需要rewiter url的)

配置如下:

#LoadModule rewrite_module modules/mod_rewrite.so   (把前面的#去掉)

Listen 82

<VirtualHost *:82>
DocumentRoot ”E:\project\webservice_clothes\root”
DirectoryIndex index.php
RewriteEngine On
RewriteCond %{REQUEST_URI} !^.*(\.css|\.js|\.gif|\.png|\.jpg|\.jpeg|\.swf|\.ico|\.php|\.htm|\.txt|\.xls)$
RewriteRule ^(/.*)$ /index.php
<Directory “E:\4project\webservice_clothes\root”>
AllowOverride All
Allow from All
</Directory>
</VirtualHost>

则你访问http://localhost:82/ 则系统自动定义到位于E:\project\webservice_clothes\root下的index.php文件

 

如果你想访问E:\project\webservice_clothes\root\phpmyadmin目录,

则可以过滤掉对phpmyadmin的重定向,修改为:

<VirtualHost *:82>
DocumentRoot ”E:\project\webservice_clothes\root”
DirectoryIndex index.php
RewriteEngine On
RewriteCond %{REQUEST_URI} !^.*(\.css|\.js|\.gif|\.png|\.jpg|\.jpeg|\.swf|\.ico|\.php|\.htm|\.txt|\.xls)$| .*(phpmyadmi).*
RewriteRule ^(/.*)$ /index.php
<Directory “E:\4project\webservice_clothes\root”>
AllowOverride All
Allow from All
</Directory>
</VirtualHost>

则用E:\project\webservice_clothes\root\phpmyadmin可以访问你的phpmyadmin,注意重启apache服务啊!

留言

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>