Re: Curious inability to mod_rewrite absolute paths

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thank you for your response.

Indeed, I stumbled upon that .htaccess rule in my reading. Even if the
prefix was stripped, shouldn't the modified link still have appeared
in the matching cascade? I carefully reviewed error.log, which didn't
even show the prefix getting stripped from the /links. Also, I
understand, if /link shouldn't work, shouldn't the //link example fail
as well?

My hypothesis is that something else in Apache is intercepting the
/links before they even get to the RewriteRules. I don't know where to
look, however.

With thanks,

On 19 November 2013 07:23, Eric Covener <covener@xxxxxxxxx> wrote:
> RewriteRule in htaccess strips the prefix used to get to the htaccess files
> directory. What you compare to will never begin with /. This should have
> been traced.
>
> On Nov 19, 2013 6:06 AM, "Borden Rhodes" <jrvp@xxxxxxxxxxxxxxxx> wrote:
>>
>> 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@xxxxxxxxxxxxxxxx
>> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx





[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux