设置的.htaccess为Zend框架 [英] Setting up .htaccess for Zend Framework

查看:148
本文介绍了设置的.htaccess为Zend框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下面的Zend Framework的教程在这里(http://www.ibm.com/developerworks/opensource/tutorials/os-php-zend2/section2.html)。我刚刚开始了,但我有问题,设立这个.htaccess文件。根据清单。 1中的链接,有$ C $的C座的文章说我需要创建:

I'm following a tutorial on Zend Framework here (http://www.ibm.com/developerworks/opensource/tutorials/os-php-zend2/section2.html). I barely got started, but I'm having problems setting up this .htaccess file. Under Listing. 1 in the link, there is a block of code the article says I need to create:

htaccess

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

php_value include_path ".;c:\ZendFramework\library"

如何创建.htaccess文件正确,这样的index.php文件,这无非是在页面上只有几个版画,将正常开启在我的本地?我的Zend是在E:\ zendframekwork \库。到目前为止,我有以下几点:

How do I create the .htaccess file properly so that an index.php file, which is nothing more than just a few prints on the page, will be opened properly on my localhost? My Zend is at E:\zendframekwork\library. So far, I have the following:

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

set_include_path('.;E:\zendframekwork\library');

正如你所看到的,我删除了htaccess的部分(我需要吗?),并改写了最后一道防线,但它显然是不正确的,我试图打开index.php文件时,仍然出现错误。我怎样写这是否正确?

As you can see, I removed the "htaccess" part (do I need that?) and rewrote the last line, but it is obviously incorrect as I still get an error when trying to open index.php. How do I write this correctly?

此外,本教程提到具有用于Zend的正确路径HTTPD.CONF指令。我抬头对我的Apache的httpd.conf文件,但并没有什么。参见Zend的。我需要为此做些什么呢?

Also, the tutorial mentions HTTPD.CONF directives having correct paths for Zend.. I looked up my HTTPD.CONF file on Apache, but there is nothing refering to Zend. Do I need to do something about this as well?

TIA !!

推荐答案

好你遵循了Zend快速入门

Better you follow the Zend Quickstart

Zend的快速入门

的.htaccess

.htaccess

    RewriteEngine on
    RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php

请检查您的httpd.conf中的一个选项覆盖将它设置为全部

Check your httpd.conf for an option "overwrite" set it to All

这篇关于设置的.htaccess为Zend框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆