SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a wiki library which contents is automatically copied onto another site. Some of the pages in the library contain images, the links to those images are relative.



image: /wiki/images/image.jpg

Now I have a script which exports the wiki and images libraries, and imports them on another site. But on that site, the library is placed in a different subsite:

Now although the images library is in the same subsite as the wiki (like it was on siteA), the images still break. They keep on pointing to /wiki/images/image.jpg instead of /

So now I'm looking for a way to correct this, preferably in a powershell script, since the exporting / importing is done in powershell too. What's a good way of doing this?

share|improve this question
Have you tried to use url token.For e.g. {SiteUrl}. I am not sure it work in wiki page – Amit Kumawat Nov 18 '11 at 16:21
up vote 3 down vote accepted


You could try modifying the content from each wiki page through powershell by replacing the old URL with the new one.

The following blog post can help you with it:

$content = $
$content = $content -replace "/wiki/images/", "/subsite/wiki/images/"

Regards, EStruyf

share|improve this answer

For future readers: I created a Powershell script which does the same, but without the need to use the webservices.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.