Forum Moderators: phranque

Message Too Old, No Replies

RewriteRule in .htaccess

More than 3 rules possible?

         

Maleville

8:57 am on Jun 16, 2003 (gmt 0)

10+ Year Member



Hi!

In a Rewrite rule condition is it possible to make 3 possibilities?
If we have:
RewriteRule \.(gif¦jpg¦jpeg¦GIF¦JPG¦JPEG)$ [other_domain.com...] [R,L]

is it possible to write:
RewriteRule \.(gif¦jpg¦jpeg)$ [other_domain.com...] [NC,R,L]

jdMorgan

2:24 pm on Jun 16, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Maleville,

Yes, you can use the [NC] flag in a RewriteRule directive.

Ref: Apache mod_rewrite documentation [httpd.apache.org]

Jim

Maleville

12:18 am on Jun 18, 2003 (gmt 0)

10+ Year Member



Jim,

Thank you.

Then, I may write:
RewriteRule \.(gif¦jpg¦jpeg)$ [other-domain.com...] [NC,R,L]

Maleville

jdMorgan

12:29 am on Jun 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



C'est vrai. :)

Jim

Slade

12:59 am on Jun 18, 2003 (gmt 0)

10+ Year Member



It's been said that you shouldn't rewrite one imagetype on top of another. In this case, you should have one each of redirect.jpg, redirect.gif, and redirect.jpeg. If you do this, change your rule something like this:

RewriteRule \.(gif¦jpg¦jpeg)$ [other-domain.com...] [NC,R,L]
Don't forget to fix the pipes.

Maleville

6:36 pm on Jun 18, 2003 (gmt 0)

10+ Year Member



1: Houlala! Jim, I didn't know that you can speak French. It was funny for me to read a post in French on this forum.

2: Thank you Slade to your advice. As I am a new user, I am running over this forum to find some help specially about .htaccess file that I discovered recently.