You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Alek Andreev <al...@post.com> on 2001/12/15 08:53:46 UTC
Rewrite Problem
Hi!
I am having a problem with mod_rewrite on Apache 1.3. I have configured
rewrite so that if a user request a page that does not exist, the request is
forwarded to a PHP script. So, if I request /non/existent/file, the server
will call index.php?p=/non/existent/file. This works fine, still I would
also like to be able to do the same in SSI files (<!--#include
virtual="/non/existent/file" -->), but the server gives me an SSI error
because the file does not exist. How can I fix that?
PS I tried the same with a 404 handler, still did not work.
Regards,
Alek Andreev
alek@post.com
---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org
Re: Rewrite Problem
Posted by darren chamberlain <dl...@users.sourceforge.net>.
Alek Andreev <al...@post.com> said something to this effect on 12/15/2001:
> Hi!
>
> I am having a problem with mod_rewrite on Apache 1.3. I have configured
> rewrite so that if a user request a page that does not exist, the request is
> forwarded to a PHP script. So, if I request /non/existent/file, the server
> will call index.php?p=/non/existent/file. This works fine, still I would
> also like to be able to do the same in SSI files (<!--#include
> virtual="/non/existent/file" -->), but the server gives me an SSI error
> because the file does not exist. How can I fix that?
>
> PS I tried the same with a 404 handler, still did not work.
What does your RewriteRule look like? If you aren't doing
something like:
RewriteEngine on
RewriteCond /your/docroot/%{REQUEST_FILENAME} !-f
RewriteRule ^(.+) http://%{SERVER_NAME}/index.php?p=$1
This should be caught by subrequests, so it should work with
server-parsed files as well as directly requested files.
(darren)
--
The kind of thinking we do sets the stage for the action we are likely
to take. Because of this, a man who refuses to develop his thinking
is likely to act on the impressions made upon him by others.
-- Dr. Claude R. Baker, "Coin In The Air"
---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org