0

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 http://abc.com/image123.gif 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?

0

2 Answers 2

0

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.

1
  • 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
    Commented Jun 15, 2011 at 3:16
0

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 %>
1
  • 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 "abc.com/image123.gif" rather than "abc.com/SiteCollectionImages/images123.gif". The later works fine, but im looking to make the former work. And the iis rewrite rule isnt helping.
    – vasya10
    Commented Jun 15, 2011 at 3:13

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