0

Is it possible to rewrite somehow www.mysite.com/Pictures to point to test.mysite.com/Pictures or even more broadly www.someothersite.com/Pictures ?

Note: www.mysite.com and test.mysite.com are on separate machines and built with different technologies (one is ASP.NET and the other is PHP) but I have access to both of them.

I want that when I reference a picture like www.mysite.com/Pictures/pic12345.png the picture to display correctly, even though there is not /Pictures folder on that server and the pictures has to be retrieved by going to test.mysite.com/Picture/pic12345.png

Ideally I want to do this in IIS6 to test it. However I am interested if it possible to do in any webserver (Apache, IIS7)

2 Answers2

0

Been a while since I worked with Asp.NET but you could write a http module that handles this for you.

Phil
  • 153
  • 4
  • Thank you, I didn't think about that, for some reason, will look into it. –  May 25 '10 at 11:17
0

Use a .htaccess file (on www.mysite.com), within which you want:

Redirect 301 /Pictures www.someothersite.com/Pictures

Alternatively, you could use mod_rewrite:

RewriteEngine on
RewriteRule ^Pictures/(.*)$ www.someothersite.com/Pictures/$1
Eric
  • 103
  • 4
  • Wouldn't that work? if I have a picture like this some pick will it display it correctly? –  May 25 '10 at 11:16
  • I think you might need ModRewrite for that usage. Hold on –  May 25 '10 at 11:26
  • Did both work, or just the second one? –  May 25 '10 at 11:39
  • Couldn't make it to work with neither yet, but it seems the second one is the right way to go, I will give it a few more tries or try variations of this. –  May 25 '10 at 13:19