SharePoint 2007搜索网站开启匿名访问
最近有一MOSS2007站点,开启了匿名访问。
奇怪的是点击搜索按钮后还要用户登录后才能搜索内容。
为了解决这个问题,GOOGLE了半天,找到一篇文章,放在这儿做个标记,http://blogs.objectsharp.com/cs/blogs/max/archive/2008/02/20/sharepoint-search-and-anonymous-users.aspx
SharePoint search and anonymous users
Posted: Wednesday, February 20, 2008 9:19 PM by max
Filed under: Sharepoint, Tips & Tricks, Security
If you have a public Sharepoint site (MOSS 2007 or WSS 3.0) that is accessible to anonymous users and you’re not using custom scopes, you probably already noticed that every time users try to search they get a user prompt. To get pass this prompt you must enter valid username, otherwise you’ll get famous “Access Denied” page. So much for anonymous access, right?
Anyway, the problem is with OSSSearchResults.aspx page, specifically with one of the inheritance reference that ASPX page. I’m talking about the part of the code that sets the inheritance of the page from the generic application page base class, which is not really required for this page to function properly.
To allow anonymous users to search your publicly available sites you need to remove that inheritance from the code, so find part of the code inside the <Page> tag that states “Inherits="Microsoft.SharePoint.WebControls.LayoutsPageBase" and remove that part of the code (not the whole line, just the part that inhertis the application page base.) OSSSearchResults.aspx page is usually stored at C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS on your SharePoint server. Make sure you backup the file before making any changes!
Making those changes will not only allow anonymous users to search the SharePoint content, but also will keep the SharePoint search secure, meaning that anonymous users will only be able to search the part of the SharePoint they have permissions to view