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] Curious inability to mod_rewrite absolute paths
Date Tue, 19 Nov 2013 11:06:18 GMT
Good morning, list,

After about 7 hours of struggling with this issue, I can't seem to
find out how to trace the cause of this issue:

I am trying to rewrite absolute URLs using a .htaccess file on my
computer being served from localhost. I have succeeded in the
following:
Using, say, an HTML file containing the tag <img
src="//www.example.com/image.png" />, I used "RewriteRule
^//(.*example\.com.*) http://$1" to get Apache to fetch the image;
Using an HTML file containing the tag <img
src="www.example.com/image.png">, I used "RewriteRule
^(.*example\.com.*) http://$1" to get Apache to fetch the image;

However, using an HTML file containing the tag <img
src="/www.example.com/image.png"> and "RewriteRule
^/(.*example\.com.*) http://$1", the webpage does not show the image.
Further, turning the LogLevel up to trace8 and picking through
error.log only shows that Apache failed to fetch the image from my
file system (that is, /home/borden/www.example...) and didn't even
pass the URL to the RewriteRule.

Could someone explain why absolute URLs (which is what I'm simulating
here) aren't getting caught by RewriteRule? The real problem I'm
trying to solve involves needing to play with Drupal in a subdirectory
of my localhost machine without changing any of the links. Therefore,
suggestions to "rewrite the <img> tags" won't help. I ran the example
from a simple website I set up in a folder on my server, not the
Drupal installation.

With thanks,

Borden Rhodes

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


Mime
View raw message