Please help with determining absolute paths using RewriteCond and RewriteRule

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 ...


Go Back   Usenet Forums > Web Server and Related Forums > Linux Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-10-2004
Jeffrey Silverman
 
Posts: n/a
Default Please help with determining absolute paths using RewriteCond and RewriteRule

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)

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:04 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0