Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-02-2011, 09:43 AM   PM User | #1
elad2109
New to the CF scene

 
Join Date: Jun 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
elad2109 is an unknown quantity at this point
htaccess -less hardcoded

Hello,

I write server-side code.
There is a web-site which asks for a file named old.png
I want the server to check the reffere url. If it's http://www.domain2.com/Bing I want it to redirect that request to another file in a different path, named new.png
For some odd reason I cannot make it rigt. could you plsease help me understand my mistake?

from fiddler:
Code:
GET http://www.domain1.com/images/old.png HTTP/1.1
Accept: */*
Referer: http://www.domain2.com/Bing
Accept-Language: en-us
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; WOW64; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Accept-Encoding: gzip, deflate
If-Modified-Since: Wed, 27 Oct 2010 10:12:22 GMT
If-None-Match: "087e171bf75cb1:0"
Host: www.domain1.com
Connection: Keep-Alive
i guess the website address domain1 because it's hard-coded path (My guess).

The strange thing is that i fired-up the whole scenario by tuping the url http://www.domain2.com/Bing , but the host is written:www.domain1.com so it's all blur for me.

My htaccess file which is attaced to http://www.domain2.com/
via ISAPI (IIS)
Code:
RewriteEngine On
RewriteCompatibility2 On
RepeatLimit 32
RewriteBase

RewriteRule ^\/Bing$ http://www.domain2.com [NC,L,P]

RewriteCond %{HTTP_REFERER} ^http://www.domain2.com/Bing [or]
RewriteCond %{HTTP_REFERER} ^http://www.domain2.com/bing
RewriteRule ^(.*)\/ActivitiesService.asmx\/GetLatest$ http://www.domain2.com/ActivitiesService.asmx/GetL... [NC,L,P]
RewriteRule ^http://www.domain1.com/images/old.png$ http://www.domain2.com/images/new.png [NC,L]

The rest is less relevant
Thanks for any asistance
elad2109 is offline   Reply With Quote
Old 03-03-2011, 01:02 AM   PM User | #2
oesxyl
Master Coder


 
Join Date: Dec 2007
Posts: 6,682
Thanks: 436
Thanked 890 Times in 879 Posts
oesxyl is a jewel in the roughoesxyl is a jewel in the roughoesxyl is a jewel in the rough
you need to know that is a problem with refferer:

http://referer.us/Spoof-HTTP-Referer.html

i'm not sure if i understand correctly, your server is IIS?
in case that is Apache or you can adapt to IIS, this could help:

http://wiki.apache.org/httpd/RewriteImageTheft

best regards
oesxyl is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:42 AM.


Advertisement
Log in to turn off these ads.