简体   繁体   English

基于Windows的apache服务器(wamp)上的cakephp和httpd.conf问题

[英]cakephp & httpd.conf issues on windows based apache server (wamp)

So, i was wondering if some one could clarify following occurrence and maybe suggest how I could tackle this. 因此,我想知道是否有人可以澄清发生的事情,并建议我如何解决这个问题。

sorry for the weird coloring of the code 对不起,代码颜色怪异

Let me explain the set up first. 让我先解释一下设置。 I have wamp server installed and it is located physically on one hd and then my development files are located on separate hd. 我安装了wamp服务器,它实际上位于一个hd上,然后我的开发文件位于单独的hd上。 So i have added alias to access specific dev folder 所以我添加了别名以访问特定的dev文件夹

in httpd.conf i have following 在httpd.conf中,我有以下内容

ServerRoot D:/Program Files/wamp/bin/apache/apache2.2.11  
Listen 80  
ServerName localhost:80  
DocumentRoot D:/Program Files/wamp/www  
<Directory />  
    Options FollowSymLinks  
    AllowOverride None  
    Order deny,allow  
    Deny from all  
</Directory>  
<Directory D:/Program Files/wamp/www/>  
    Options Indexes FollowSymLinks  
    AllowOverride all  
    Order Allow,Deny  
    Allow from all  
</Directory>  

following is in seperate conf file and included into httpd.conf 以下内容位于单独的conf文件中,并包含在httpd.conf中

Alias /project_birthday_planner "E:/Development/--- Projects-Full/PROJECT - BirthdayPlanner/trunk/"  
<Directory E:/Development/--- Projects-Full/PROJECT - BirthdayPlanner/trunk/>  
    Options Indexes FollowSymlinks MultiViews  
    AllowOverride All  
    Order allow,deny  
    Allow from all  
</Directory>  

in my E:/Development/--- Projects-Full/PROJECT - BirthdayPlanner/trunk/ i have my cakephp directories and files 在我的E:/ Development / --- Projects-Full / PROJECT-BirthdayPlanner / trunk /中,我有我的cakephp目录和文件

here is the problem 这是问题

my mode rewrite is turned on and my htaccess files for following cakephp folders are as following, 我的模式重写已打开,以下cakephp文件夹的htaccess文件如下,

root of the cakephp Cakephp的根

<IfModule mod_rewrite.c>  
    RewriteEngine on  
    RewriteBase /  
    RewriteRule ^$ /app/webroot/ [L]  
    RewriteRule (.*) /app/webroot/$1 [L]  
</IfModule>  

*\\app* * \\ app *

<IfModule mod_rewrite.c>  
    RewriteEngine on  
    RewriteBase /  
    RewriteRule ^$ /webroot/ [L]  
    RewriteRule (.*) /webroot/$1 [L]  
</IfModule>  

*\\app\\webroot* * \\ app \\ webroot *

<IfModule mod_rewrite.c>  
    RewriteEngine On  
    RewriteBase /  
    RewriteCond %{REQUEST_FILENAME} !-d  
    RewriteCond %{REQUEST_FILENAME} !-f  
    RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]  
</IfModule>  

when I access /project_birthday_planner i get following error 404 Not Found 当我访问/ project_birthday_planner时,出现以下错误404 Not Found

**Not Found**  
The requested URL /app/webroot/ was not found on this server.  

if i set DocumentRoot to my cakephp folder or move cakephp folders and files to initial DocucumentRoot folder, all fires up and works. 如果我将DocumentRoot设置为我的cakephp文件夹,或者将cakephp文件夹和文件移动到初始DocucumentRoot文件夹,则所有命令都会启动并起作用。

question is how do i tackle this issue, is this something that inherently comes with the use of apache Alias or am I missing some piece 问题是我该如何解决这个问题,这是使用Apache Alias固有地带来的东西,还是我错过了一些东西?

should this set up be tackled via VirtualHost then? 应该通过VirtualHost解决此设置吗?

thank you so much in advance 提前非常感谢你

您必须将Rewritebase指向正确的路径...请参见此处

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM