[ Team LiB ] |
Recipe 5.14 Rewriting Based on the Query StringProblemYou want to translate one URI into another based on the value of the query string. SolutionPut this in your httpd.conf: RewriteCond "%{QUERY_STRING}" "^user=([^=]*)" RewriteRule "/userdirs" "http://%1.users.example.com/" [R] Discussionmod_rewrite does not consider the query string as part of the URI for matching and rewriting purposes, so you need to treat it separately. The given example translates requests of the form:
The [R] tells mod_rewrite to direct the browser to the URL constructed by the RewriteRule directive. See Also |
[ Team LiB ] |