if then else

New to mod_rewrite? This is a good place to start.

if then else

Postby Guest » Tue Jan 06, 2004 2:12 pm

I turn to you because nobody know the answer, so please help me.

I don't know how to write rule if=then=else file exist then redirect.

Let say I have "pics_001.jpg" and thumbnail "tb_pics_001.jpg", so I want site normally show my thumb (tb_pics_001.jpg) in html but if u click on thumb for bigger pics, apache redirect to different URL.

This script redirects all pics, even tb_pics_001.jpg, so I need to add some variable. Any idea from mod_rewrite guru.

RewriteEngine ON
RewriteCond %{HTTP_REFERER} ^http://www.mysite.com/gallery.html.*$ [NC]
RewriteRule ^.*_001.jpg$ http://www.mysite.com/redirect.html [R,L]

Have a nice day Ralf :)
Guest
 

Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 45 guests

cron