You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Donald Raikes <do...@draikes.com> on 2004/10/15 19:23:15 UTC

[users@httpd] rewriteRule problem



------------------------------
God Bless,
Don Raikes
http://www.draikes.comHello,

I have a virtual host in my apache 1.3 configuration.
The virtual host is pointing to another server on a different port.

All was working fine with the rules I had except the images were not
showing up.

I added the rule:
RewriteRule (.*)\.gif
http://access.us.oracle.com:8888/st-acc2/cabo/images/$1.gif [P,L]

This worked for all but 2 images.
The other two images are in a different folder.

I tried adding:
RewriteRule (.*)disabled3.gif
http://access.us.oracle.com:8888/st-acc2/disabled3.gif$1 [P]

but when I try to reference the disabled3.gif using:
http://staccessibility.us.oracle.com/disabled3.gif,
I get a 404 file not found
http://access.us.oracle.com:8888/st-acc2/cabo/images/disabled3.gif

What is wrong with my rules?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] rewriteRule problem

Posted by Donald Raikes <do...@draikes.com>.
Joshua,
Thanks, once again your advice was great. Hopefully, I have everything
working now.
On Fri, October 15, 2004 10:37, Joshua Slive said:
> On Fri, 15 Oct 2004 10:23:15 -0700 (MST), Donald Raikes <do...@draikes.com>
> wrote:
>> I added the rule:
>> RewriteRule (.*)\.gif
>> http://access.us.oracle.com:8888/st-acc2/cabo/images/$1.gif [P,L]
>>
>> This worked for all but 2 images.
>> The other two images are in a different folder.
>>
>> I tried adding:
>> RewriteRule (.*)disabled3.gif
>> http://access.us.oracle.com:8888/st-acc2/disabled3.gif$1 [P]
>>
>> but when I try to reference the disabled3.gif using:
>> http://staccessibility.us.oracle.com/disabled3.gif,
>> I get a 404 file not found
>> http://access.us.oracle.com:8888/st-acc2/cabo/images/disabled3.gif
>>
>> What is wrong with my rules?
>
> Have you use the RewriteLog?  It is pretty-much essential when dealing
> with mod_rewrite.
>
> You'll probably find there that the *.gif rule is applying first, and
> therefore your disabled3.gif rule never gets a chance.  List the more
> specific rule first in the config file and add an L to the flags to
> make sure the other rule doesn't get used.
>
> I also don't see why you are tagging the $1 on to the end of the URL.
>
> Joshua.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


------------------------------
God Bless,
Don Raikes
http://www.draikes.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] rewriteRule problem

Posted by Joshua Slive <js...@gmail.com>.
On Fri, 15 Oct 2004 10:23:15 -0700 (MST), Donald Raikes <do...@draikes.com> wrote:
> I added the rule:
> RewriteRule (.*)\.gif
> http://access.us.oracle.com:8888/st-acc2/cabo/images/$1.gif [P,L]
> 
> This worked for all but 2 images.
> The other two images are in a different folder.
> 
> I tried adding:
> RewriteRule (.*)disabled3.gif
> http://access.us.oracle.com:8888/st-acc2/disabled3.gif$1 [P]
> 
> but when I try to reference the disabled3.gif using:
> http://staccessibility.us.oracle.com/disabled3.gif,
> I get a 404 file not found
> http://access.us.oracle.com:8888/st-acc2/cabo/images/disabled3.gif
> 
> What is wrong with my rules?

Have you use the RewriteLog?  It is pretty-much essential when dealing
with mod_rewrite.

You'll probably find there that the *.gif rule is applying first, and
therefore your disabled3.gif rule never gets a chance.  List the more
specific rule first in the config file and add an L to the flags to
make sure the other rule doesn't get used.

I also don't see why you are tagging the $1 on to the end of the URL.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org