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

Possible Duplicate:
Support for URL rewriting?

I have some files under SharePoint 2010's SiteCollectionImages library. But I need to access them as root, for eg must be possible, though image123.gif is in root web's SiteCollectionImages library. I did put a Rewrite Rule in IIS, but I get a 404. in the uls logs, I can see the request going into SharePoint, but from their it returns 404 error code.

I can check via sharepoint designer that the file is there and its content type is set to Image. In Firefox I get "image cannot be displayed as it contains errors" and IE shows just 404.

Any ideas?

share|improve this question

marked as duplicate by Alex Angas Jul 14 '11 at 8:00

This question was marked as an exact duplicate of an existing question.

Can't you just move or copy the image files to the root of your SharePoint site? You can do this in SharePoint Designer. If your required URL has the image at the root, that is where I would put the image files.

I would also avoid rewriting if at all possible. It can break things in SharePoint and isn't supported.

share|improve this answer
the images are at the root sc only in the SCI library. But you are right, the more I think of it, the iis rewrite rule makes sp look into the physical directory, likely within _layouts. I see some ULS logs pointing to this effect. SiteCollectionImages being part of "virtual dir" may be isn't handled that way. – vasya10 Jun 15 '11 at 3:16

If your site collection is the root site collection you can just use: "/SiteCollectionImages/image123.gif" since this will default to the root site collection.

If your site collection is not the root (e.g. http://server/sites/mySiteCollection), then you'll need this syntax:

<% $SPUrl:~SiteCollection/SiteCollectionImages/image123.gif %>
share|improve this answer
Yes this is possible, but im not after that. Yes my sc is root sc. But I want to be able to access the image file via url ""; rather than "";. The later works fine, but im looking to make the former work. And the iis rewrite rule isnt helping. – vasya10 Jun 15 '11 at 3:13

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