蛋糕PHP &基于 Windows 的 apache 服务器 (wamp) 上的 httpd.conf 问题

发布于 2024-08-23 05:39:16 字数 2512 浏览 4 评论 0原文

所以,我想知道是否有人可以澄清以下发生的情况,并建议我如何解决这个问题。

对代码的奇怪颜色感到抱歉

让我先解释一下设置。我安装了 wamp 服务器,它物理上位于一个硬盘上,然后我的开发文件位于单独的硬盘上。因此,我添加了别名来访问特定的开发文件夹

在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>  

以下内容位于单独的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>  

我的E中的httpd.conf中: /Development/--- Projects-Full/PROJECT -birthdayPlanner/trunk/ 我有我的 cakephp 目录和文件

这是问题

我的模式重写已打开,我的 htaccess 文件如下cakephp 文件夹如下,

cakephp 的根目录

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

*\app*

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

*\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>  

当我访问 /project_birthday_planner< 时 /strong> 如果我将 DocumentRoot 设置为 cakephp 文件夹或将 cakephp 文件夹和文件移动到初始 DocumentRoot 文件夹,我会收到以下错误 404 Not Found

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

,所有这些都会启动并正常工作。

问题是 我该如何解决这个问题,这是使用 apache Alias 固有的问题吗? 或者我是否遗漏了一些内容,

应该通过 VirtualHost 来解决此设置?

非常感谢你提前

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. So i have added alias to access specific dev folder

in httpd.conf i have following

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

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

here is the problem

my mode rewrite is turned on and my htaccess files for following cakephp folders are as following,

root of the cakephp

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

*\app*

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

*\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

**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.

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

should this set up be tackled via VirtualHost then?

thank you so much in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

世界和平 2024-08-30 05:39:16

您必须将重写库指向正确的路径...请参阅此处

You have to point the Rewritebase to the right path ... see here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文