English 中文(简体)
找不到带有虚拟主机和 mod_ rewrite 的文件
原标题:File not found with VirtualHost and mod_rewrite

I m bulding a RESTful api based on Tonic. On my developer machine and our stage server we use virtual hosts.

Tonic 使用.htaccess 文件将comming 呼叫翻译到它 s 调度器.php 文件。 这在服务器上正常运行, 没有启用“ 虚拟主机 ” 。

然而,如果我启用虚拟主机, 我就会找到一个找不到的文件, 甚至认为文件的路径和名称是正确的 。

这是我开发商机器上的虚拟主机装置

<VirtualHost *:80>
    ServerAdmin admin@xxxxxxxxxxxx
    ServerAlias *.dev.xxxxx
    VirtualDocumentRoot /home/xxxxxxxx/workspace/%1
    <Directory /home/xxxxxxxx/workspace/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
    </Directory>

</VirtualHost>

Tonics.htaccces 位于一个文件夹中, 叫做工程根的休息点 :

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_URI} !dispatch.php$
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule .* dispatch.php [L,QSA]
</IfModule>

电话http://project.dev.xxxxxx/rest/ 提供:

Not Found
The requested URL /home/xxxxxxxx/workspace/project/rest/dispatch.php was 
not found on this server.

Apache/2.2.22 (Ubuntu) Server at xxxxxxx Port 80
最佳回答

似乎您再次滥用了 虚拟文档Rooot 。 请尝试将其修改为 :

Documentroot/home/xxxx/workspace/project/rest /Documentroot/home/homexxxxxx/workspace/project/rest

Also, here s a good explanation on the VirtualDynamicRoot: Dynamically configured mass virtual hosting

希望这有帮助。

问题回答

暂无回答




相关问题
Using SimplePie with CodeIgniter and XAMPP

I am using CodeIgniter 1.7.2 with XAMPP 1.7.2 on a Windows computer. I am trying to make use of SimplePie. I followed all the instructions I could find: a copy of simplepie.inc is in my applications/...

Multiple Sites with common files

I have developed over 50 sites that all use the exact same files other than CSS and IMAGES, I currently duplicate the files each time I create a new site and upload different css and images. What ...

http server validation

I finish a litle http server, writing from scratch. I would like to be sure that my imlementation is conforme to the HTTP specifications. W3C give us tools for HTML/XML conformance, but i see nothing ...