oshirowanen
oshirowanen

Reputation: 15965

proper way to write your links for use on multiple domains

If I have multiple domains all pointing to the same website, how are you supposed to write your links so they do not break when used via a different domain, .e.g

Imagine I have the following domains for the same website

oshirowanen.com
oshiro_wanen.com
osh.i.ro.wa.nen.com

if I had a html link as follows

<img src="http://www.oshirowanen.com/images/me.jpg" />

That would only be displayed if users went to oshirowanen.com.

How should that img tag be done properly so it works on all 3 domains?

Upvotes: 1

Views: 84

Answers (3)

clmarquart
clmarquart

Reputation: 4721

Like this: <img src="/images/me.jpg" />, the src is from the root of whatever domain that page is accessed from.

Upvotes: 1

Matthew Wilson
Matthew Wilson

Reputation: 3929

Just

 <img src="/images/me.jpg" />

Upvotes: 3

David
David

Reputation: 16

If all your domains point to the same index, then you can just use relative paths

<img src="images/me.jpg"/>

Upvotes: 0

Related Questions