URL mapping to FastCGI app
Bryan White <[email protected]>
| Newsgroups | gmane.comp.web.fastcgi.devel |
|---|---|
| Message-ID | <[email protected]> |
This question is not FastCGI specific, but it may be that FastCGI affects the solution so I am asking it here. I have a FastCGI C++ app that runs our main site. I have been tasked with shortening the URLs that are used to access the app. Originally the URLs looked something like this: http://DOMAIN/cgi-bin/APPNAME/CHANNEL/CONTEXT where CONTEXT was 0 or more PATH_INFO parameters. I have sucessfully mapped http://DOMAIN/ to the app and eliminated cgi-bin from all URLs. What I want to do is eliminate APPNAME from the URL when there is a CHANNEL. The CHANNEL is an alphanumeric keyword that is looked up in our database. The resulting urls would look like: http://DOMAIN/CHANNEL/CONTEXT where CONTEXT might be blank. I would rather not maintain a list of rewrite rules in either httpd.conf or an .htaccess file. Instead I want the FastCGI app to be the handler for all names in the top level of the document directory where the name is not a physical file or directory. I thought of trying to redirect the ErrorDocument into my app but this seems like a hack that may come back to haunt me. I could maybe do it with a single RewriteRule if it had a flag that said to only apply if the file/directory did not exist. I suppose I could use a custom file extension with a RewriteRule that matched the extension and a handler for that extension. That would almost get me to where I want to be. The URLs would look like http://DOMAIN/CHANNEL.EXT/CONTEXT Does anyone have other suggestions? -- Bryan White Mal: "Well, my days of not taking you seriously are certainly coming to a middle." Simon: "This must be what going mad feels like." ___________________________________ fastcgi-developers mailing list http://fastcgi.com/fastcgi-developers/