Rewrite? Alias?
Posted by: rjbrown
Posted on: 2006-07-02 22:18:00
I have a tricky problem that I'm hoping someone here knows how to handle.
I need to route a bunch of different "script names", that could be preceded by random paths, to a single script.
For instance, one url might be
http://mydomain.com/2006/4/monthlisting?display=thread&page=1
and another might be
http://mydomain.com/2006/4/12/article?id=3
They all need to go to the same script (which is technically a fastcgi executable). The script, in turn, will look at the path (shown in red) and the script name (shown in blue), and the parameters and go from there. I don't need help with the part that happens within the script, just the way to set up .htaccess to route all of those urls to the single script.
BTW, there will be a limited number of script names (so each can be given a line in .htaccess), but there could be any number of paths.
I have done this before, on a web server where I had access to httpd.conf....this is what I added:
FastCGIServer /usr/local/apache2/fastcgi-bin/myapp -port 9014
and then
AliasMatch /*/article /usr/local/apache2/fastcgi-bin/myapp
AliasMatch /*/monthlisting /usr/local/apache2/fastcgi-bin/myapp
which worked great. But I don't have access to httpd.conf here, and don't have the ability to configure fastcgi any way I want.
Any ideas how I can accomplish this? Can this be done with a rewrite rule? I know there aren't too many fastcgi people here, but I imagine that most of the techniques would apply to other things as well.
Thanks for any help....
-rob