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