httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Borden Rhodes <j...@bordenrhodes.com>
Subject [users@httpd] Re: Curious inability to mod_rewrite absolute paths
Date Mon, 06 Jan 2014 05:45:27 GMT
> Because the absolute path does not go anywhere near the "dummy"
> directory which is where your .htaccess file is, so the .htaccess file
> never gets read for that request.
Aaaahhhhhhhh. OK. Thanks! That clarifies a *lot* of things - and makes perfect 
sense, too. It seems that I somehow got into the mindset that, since the image 
file was being requested from within a file located in the same folder as 
.htaccess, that .htaccess would apply against those requested files. However, 
this would mean that httpd would have to keep track of the referrers, which, I 
think, is what Tom warned me that I was trying to do but I misunderstood.

If I've read it correctly, /docs/current/getting-started.html gives a summary 
of how the HTTP client/server relationship works and a very high-level 
overview of HTTP. The documentation may benefit from a diagram or 'sample 
conversation' between a client and server so that people new to httpd (like 
me) understand exactly what httpd does and, more importantly, what it doesn't 
do. I checked Safari and couldn't really find a book that explains httpd beyond 
how to install it on a particular system. Perhaps adding this theory to the 
Apache doc would help people like me get into the correct paradigm? If so, 
I'll try to 'repay' by suggesting changes to the docs unless someone can 
suggest a resource that I *should* have consulted first to help me understand 
how HTTP and httpd work.

> Put your .htaccess file somewhere that it will actually be read for the
> requests which you want it to affect.
Which means that I'm right back to changing the VirtualHost configuration, but 
at least I understand now why it has to work this way.

> BTW, you don't need mod_rewrite for this sort of redirection. mod_alias
> would do just as well and be more lightweight and less confusing. Your
> choice, however.
I understand from the docs that Alias directives can't be used in .htaccess 
files. Is this correct? This inability is partly why I kept struggling with 
RewriteRules - the other was to force myself to practise regexes and advanced 
configuration. 

> All the best,
> 
> Pete

Much obliged and grateful.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message