是否支持URL重寫?


57

SharePoint 2010中是否有任何可以處理此問題的內容?如果不是,那麼誰能建議從哪裡開始實施可以使我重寫URL的內容,從而使它們更加SEO和用戶友好?

例如,我有以下網址:

http://mySite.com/igs/isapps/Documentation/Forms/AllItems.aspx?RootFolder=%2Figs%2Fisapps%2FDocumentation%2FDept%20of%20Social%20Services%20ISA%20Processes&FolderCTID=0x0120005714AE5SFBAA334D4EA0BC44CD9F3308CD&View={23BE8E1-563C-4B98-97E9-DC4FF53C38B8}

我想將其重寫為如下形式:

http://mySite.com/InformationServices/SocialServicesProcesses
13

If you have TMG in place, you may be able to write some rules to do a redirect of your friendly URL to the less friendly SharePoint URL, but you'd have to define each one. There's no way that I know of for a rewrite to take place that will be smart enough to navigate into a folder and pull out the right URL parameters automatically to take the user there.

Just saw this over on Joel Olsen's blog also: http://www.sharepointjoel.com/Lists/Posts/Post.aspx?ID=439


21

No: you should not use URL rewriting with SharePoint. There is no built-in stuff or anything like that. SharePoint is a very URL focused product and many things can go wrong when rewriting URLs.

Yes: you could create some 302 redirect to have more friendly URL's.

It depends: the are some scenarios (mostly for public facing websites) where URL redirection might be considered. But consider it very carefully. Things might not work as expected...


41

There is no built-in SharePoint mechanism to do this. It is frequently requested, particularly for public-facing sites, usually for purposes of SEO and for vanity domains. In both cases the re-writing is usually unnecessary and should be resisted. Apart from anything else, URL rewriting is not supported. It can also affect performance significantly if you have complex rules, and you risk breaking something in SharePoint.

Having said that, we live in the real world ;-)

Microsoft have an add-on for IIS7 called URL Rewrite that does the job. There is also a third-party module called urlrewriter.net. Both of these work; neither are supported. You will need to disable them or possibly remove them to get support from Microsoft. But I would still avoid using rewrites unless it was really necessary.

A better approach may be to redirect rather than rewrite. This means sending a 301 (permanent) or 302 (temporary) redirect to the browser. It involves an additional round-trip to the browser, and the actual URL will appear in the browser address bar, but depending on circumstances this may be acceptable. This method is supported because you are not interfering with the actual SharePoint URL. Rewriters are usually also capable of doing redirects, or you may be able to use a SharePoint redirect page depending on the required URL.


5

There are third party Add-Ons(like this: sharepoint short url),which can remap(302 redirect) sharepoint url.


11

Official Microsoft support for URL rewriting are now published as a Microsoft Knowledgebase article:

http://support.microsoft.com/kb/2818415