1

First of all, I'vre read every question about this kind of topic but except one of them, isn't replied.

I have an Apache 2.2 Server

Server
|-foo
|-bar
|-piz
|-target
 |-www
 |-rest_service

And i'm implementing a PHP-REST Service on /target/rest_service. For it, I'm installing Slim or Tonic Framework, and neither of them works. I studied it for a time, and I think that the problem is because de .htaccess file isn't being readed from Apache, so, Apache doesn't redirect .../rest_service/question/data to .../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\" ( from 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]

I just want to redirect every path up (!or below) .../rest_service/ to .../rest_service/index.php so .../rest_service/users/7 is being proccesed by .../rest_service/index.php

Lot of thanks

EDIT! - MORE INFO:

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 -> nothing!

EDIT - Partial Solution!

At the starting point, at the base Directory (localhost/), I have AllowOverride to None, that's the reason why I'm enabling an VirtualHost, to have two different configs. (localhost/[ foo | bar | piz ]) and (localhost:port/).

IF I SET AllowOverride all IT WORKS!, but, I want to have a configuration appart for the rest of the server. Is there any way?

Ger Soto
  • 328
  • 2
  • 12
  • Anything in the server logs? Are `.htaccess` style files enabled at all and what names are registered to be considered? – arkascha May 30 '13 at 08:29
  • I edited the question with the log results. Also I writted some stuff in .htaccess and it didn't threw any 500 error, so, it's the reason it makes me think about apache is ignoring my htaccess file. – Ger Soto May 30 '13 at 08:39
  • Well, obvioously there is nothing in the rewrite log, it says in the logfile you posted: "File does not exist". how do you expect something to be in there? – arkascha May 30 '13 at 08:45
  • What happens if you request the `.htaccess` file directly via a browser? – arkascha May 30 '13 at 08:46
  • if I request .htaccess it shows me the content of the file. – Ger Soto May 30 '13 at 08:51
  • 1
    Ok, so the paths are correct, but obviously your http server is not configured to use `.htaccess`style files at all. So either other names are monitored (check for a AccessFileName directive in your configuration) or the support is not compiled in. – arkascha May 30 '13 at 11:29
  • Sorry, I solved it, but in a way that I don't like so much – Ger Soto May 30 '13 at 12:20
  • What an informative finishing line... Is there a reason why you keep your solution and your feeling a secret? – arkascha May 30 '13 at 12:26
  • No, I edited the problem!!... I was editing the main post!! No, there is a slightly different problem ( but the same question!). Lot of thanks! – Ger Soto May 30 '13 at 12:30

0 Answers0