[ Team LiB ] |
Recipe 5.18 Turning Document Names into ArgumentsProblemYou want to redirect requests for documents to a CGI script, or other handler, that gets the document names as an argument. SolutionUse RewriteRule in httpd.conf: RewriteRule "^/dir/([^./]*)\.html" "/dir/script.cgi?doc=$1" [PT] DiscussionThis solution causes all requests for HTML documents in the specified location to be turned into requests for a handler script that receives the document name as an argument in the QUERY_STRING environment variable. The PT flag should be included to allow any appropriate subsequent URL rewriting or manipulation to be performed. See Also |
[ Team LiB ] |