httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edgar Frank <ef-li...@email.de>
Subject [users@httpd] RewriteRule - webspace vs. filesystem
Date Mon, 08 Feb 2010 13:23:58 GMT
Hello list,

I've got a problem with RewriteRule and the separation of web
space and filesystem.

I want to rewrite virtual directories on the server to the URL
/index.php

/index.php exists only inside the webspace and does not reside
physically on the webserver. It is forwarded via FastCGI to an
external server with a Location section and a SetHandler
directive (which I can confirm to work for
http://myhost/index.php).

This is the relevant, minimal configuration:

DocumentRoot /www
RewriteRule /dir /index.php

<Location "/index.php">
  SetHandler ...
</Location>


PHP will look at the REDIRECT_URL / REQUEST_URI env-var (this is
imposed by the Zend framework and the project restrictions) to
figure out how it was called.

The problem I have is, that Apache complains that /www/index.php
is not found - which is absolutely right, as index.php only
exists in the webspace and not in the filesystem. But I would
expect Apache to consider the Location section instead and not
to try URL-to-file-mapping.

The access log says:
[...] "GET /dir HTTP/1.1" 404 [...]

The error log says:
[...] File does not exists: /www/index.php

The rewrite log says:
[...initial] (2) init rewrite engine with requested uri /dir
[...initial] (3) applying pattern '/dir' to uri '/dir'
[...initial] (2) rewrite '/dir' to '/index.php'
[...initial] (2) local path result: /index.php
[...initial] (2) prefixed with document_root to /www/index.php
[...initial] (1) go-ahead with /www/index.php [OK]

The [R] flag is not applicable as this would result in a loss of
the env-vars which PHP needs.

How can I solve this problem? Maybe there is a flag for the
RewriteRule I missed? Some basic misunderstanding in internal
RewriteHandling? Is this even possible?

Regards,
Edgar
--
Edgar Frank <ef-lists@email.de>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message