[FASTCGI] FastCGI and mod_rewrite don't go well together...?!? Bugor Feature or UI (as in "user incompetence")?

Rob Saccoccio robs at fastcgi.com
Sun Nov 9 09:42:05 EST 2008


This should work fine, but I wouldn't expect the rewritten uri to be in
REQUEST_URI.  

 

I think what you're looking for is in REQUEST_FILENAME.  Have a closer look
at the mod_rewrite docs.

 

mod_fastcgi should, in general, do the same thing that mod_cgi does.  IOW,
if you ever question whether mod_fastcgi is doing the right thing, try it
with mod_cgi.

 

Rob

 

 

  _____  

From: fastcgi-developers-bounces+robs=fastcgi.com at mailman.fastcgi.com
[mailto:fastcgi-developers-bounces+robs=fastcgi.com at mailman.fastcgi.com] On
Behalf Of Gabriel Petrovay
Sent: Sunday, November 09, 2008 6:23 AM
To: fastcgi-developers at mailman.fastcgi.com
Subject: [FASTCGI] FastCGI and mod_rewrite don't go well together...?!?
Bugor Feature or UI (as in "user incompetence")?

 

Hi all,

I use FastCGI together with mod_rewrite for a site. Here is my .htaccess
file content for the DocumentRoot directory:

AddHandler fastcgi-script .exe
Options +FollowSymLinks +ExecCGI

RewriteEngine On

# rewrite empty URIs to /default/index
RewriteRule ^$|^/$ /default/index [QSA]

# if the requested path does not match a file, rewrite the URI and execute
the fcgi script
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /fcgi-bin/sausa_fcgi.exe [QSA,L]

---------------------

What I am trying to achieve is: I want to have the default page
http://localhost/default/index when the user asks only for http://localhost
or http://localhost/.

The FastCGI script handles the request http://loclhost/default/index
corectly. Meaning that I get my expected result. (FastCGI picks the
/default/index resource from another location).

When I log the internal requests for http://localhost/ I get the following
list:
/
/default/index
/fcgi-bin/sausa_fcgi.exe

but inside the FCGI handler, the REQUEST_URI in request->envp tells me only
"/". Does that mean that FastCGI cannot handle internal requests generated
by RewriteRule (mod_rewrite) and can only give me only the initial request
uri?

I use the following FCGI library function calls:

FCGX_Accept_r(&request)
FCGX_GetParam("REQUEST_URI", request.envp)

I was expecting that FCGX_GetParam returns "/default/index" and not "/"

Thanks!
Regards,
-- 
MSc Gabriel Petrovay
MCSA, MCDBA, MCAD
Mobile: +41(0)787978034

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.pins.net/mailman/private.cgi/fastcgi-developers/attachments/20081109/ae85f0ed/attachment.html>


More information about the FastCGI-developers mailing list