Point subdirectory to another domain is IIS 6

Posted on

Point subdirectory to another domain is IIS 6 – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about apache-2.2, url, iis-6, rewrite, .

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)

Solution :

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

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

Leave a Reply

Your email address will not be published.