首先,我读过关于这类话题的每一个问题,但除了其中一个,没有回复。
我有一个Apache 2.2服务器
Server
|-foo
|-bar
|-piz
|-target
|-www
|-rest_service
我正在/ target / rest_service上实现PHP-REST服务。对于它,我正在安装Slim或Tonic Framework,它们都不起作用。我研究了一段时间,我认为问题是因为de .htaccess文件没有被Apache引用,所以,Apache没有将... / rest_service / question / data重定向到... / rest_service /的index.php
的httpd.conf
...
#LoadModule reqtimeout_module modules/mod_reqtimeout.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
...
<VirtualHost *:8080>
DocumentRoot "E:\me\workspace\target\rest_service"
#ErrorLog "logs/mysite.com-error.log"
#CustomLog "logs/mysite.com-access.log" combined
RewriteLog "E:\me\workspace\target\rest_service\rewrite.log"
<Directory "/target/rest_service">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
.htaccess on“E:\ me \ workspace \ target \ rest_service \”(来自Slim Framework)
RewriteEngine On
# Some hosts may require you to use the `RewriteBase` directive.
# If you need to use the `RewriteBase` directive, it should be the
# absolute physical path to the directory that contains this htaccess file.
#
#RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]
我只想重新定向每个路径(!或以下)... / rest_service / to ... / rest_service / index.php so ... / rest_service / users / 7正在被... / rest_service / index.php的
非常感谢
EDIT! - 更多信息:
的server.log
[Thu May 30 10:20:13 2013] [notice] Child 2820: Starting 64 worker threads.
[Thu May 30 10:20:13 2013] [notice] Child 2820: Starting thread to listen on port 8080.
[Thu May 30 10:20:13 2013] [notice] Child 2820: Starting thread to listen on port 80.
[Thu May 30 10:20:13 2013] [notice] Child 2820: Starting thread to listen on port 8888.
[Thu May 30 10:20:13 2013] [notice] Child 4196: All worker threads have exited.
[Thu May 30 10:20:13 2013] [notice] Child 4196: Child process is exiting
[Thu May 30 10:20:18 2013] [error] [client 127.0.0.1] File does not exist: E:/.../rest_service/users/7
rewrite.log - &gt;什么!
编辑 - 部分解决方案!
在起始点,在基本目录(localhost /)上,我有 AllowOverride为None ,这就是为什么我启用VirtualHost,有两个不同的配置。 (localhost / [foo | bar | piz])和(localhost:port /)。
如果我设置AllowOverride所有IT工作!,但是,我想为服务器的其余部分配置appart。有什么办法吗?