Forum Moderators: phranque

Message Too Old, No Replies

Redirect to another domain, keeping the url

         

thinkap

4:29 pm on Jul 29, 2010 (gmt 0)

10+ Year Member



I don't know if this is possible but I'm trying to set up a rule that will show images from domain 2 as if they are on domain 1.

For example:

http://www.domain1.co.uk/images/blah.jpg
would load
http://www.domain2.co.uk/images/blah.jpg
but keeping the domain1 url in the address bar.

We have a .co.uk and a .ie domain, both administered from a CMS on the .co.uk site. Without uploading images to both sites in the CMS I was hoping to upload to the .co.uk and mask the .ie images folder to look at the other domain.

If anyone can help i'd appreciate it.

Thanks

g1smd

9:01 pm on Jul 29, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Do the two domains have separate hosting?

thinkap

8:04 am on Jul 30, 2010 (gmt 0)

10+ Year Member



They are on the same Linux server, set up as 2 seperate domains. Our hosting provider can give the domains access to copy files between the two, which is fine for code we write, but we also use a wysiwyg editor to upload images too which I can't control.

jdMorgan

1:57 am on Jul 31, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ask your host if it would be possible to Alias or SymLink the image path. This method depends on the sites being on the same physical server, but is most efficient, as the 're-mapping' is taking place entirely within the server machine's filesystem. Permissions may be problematic, so ask.

If not, ask if it would be possible to reverse-proxy image requests from domain1 to domain2, and to configure the X-Forwarded-For headers on domain1 and custom logging on domain2 to keep the logs and stats valid.

Otherwise, I'd suggest setting up an 'images' subdomain of one or the other domains, and simply linking to the images there.

Jim

thinkap

11:20 am on Aug 16, 2010 (gmt 0)

10+ Year Member



Brilliant, cheers.
They were able to set up a SymLink for the image paths I needed and it worked exactly as I wanted.

Thanks for your help.