This is a discussion on Please help with determining absolute paths using RewriteCond and RewriteRule within the Linux Web Servers forums, part of the Web Server and Related Forums category; Hi, all! I am tearing my hair out here... I want to rewrite some URLs based on the absolute path ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi, all! I am tearing my hair out here...
I want to rewrite some URLs based on the absolute path and whether the resulting thing being looked for is actually a real file or directory or not. The Apache mod_rewrite documentation is pretty good and so is the companion rewriting guide, but they are lacking some details that I need to understand. Question: It seems to me that REQUEST_URI, REQUEST_FILENAME, and SCRIPT_FILENAME all contain the exact same information. Unfortunately, none of these contain the absolute path to the resource. What CGI variable accessible to mod_rewrite can be used for this? I need the FULL path that mod_rewrite thinks leads to the resulting resource. I don't want to use %{DOCUMENT_ROOT}%{REQUEST_URI} or type in the start of the path a la /home/webmaster/public_html%{REQUEST_URI} because sometimes the start of the path is not DOCUMENT_ROOT or the hard-coded stuff before REQUEST_URI. As in the case of a user's home directory accessed in the tilde-username style - e.g. http://myserver/~jeff/test.php . How can mod_rewrite get the full path from, say, the last URL example -- http://myserver/~jeff/test.php ?? I hope I have made this clear. Please let me know how I can further clarify. Thanks in advance! -- Jeffrey D. Silverman | jeffreyPANTS@jhu.edu ** Website | http://www.newtnotes.com (** Drop "pants" to reply by email) |