Best practice for SharePoint url 을/리다이렉션
-
05-07-2019 - |
문제
내용주 사용하는 이끼는 2007 년을 위한 우리의 회사 인트라넷에 있습니다.그것을 실행에 유일하게 안전한 http 이며 또한 외부로 노출되를 통해 세계 ISA.나는 현재 요구를 추가하는 URL 을 전달하는 우리 사이트는 다음과 같이가 발생합니다.
intranet.mycompany.com/vanityname
리디렉션을->
intranet.mycompany.com/somedeeplink/default.aspx
나는 완전히 기대하는 이런 일이 더 인기가 될 것입니다 우리의 이용자간에 간다.그래서 나는 솔루션을 찾고 하는 것입니다.내가 읽은 다양한 기사에 대해 생성/사이트/으로 전달하는 메타 태그나 전달 SharePoint 페이지 유형입니다.을 본 적이 있는 것에 대해 이야기를 추가하는 가상 디렉토리 등 직접 에서 IIS.이러한 모든 솔루션을 것 같 잔인하고 필연적으로 메모리를 적게 사용 또는 처리 시간은 웹에서 서버가 있습니다.
나는 현재 기대어로 쓰는 http 모듈에서 구성할 수 있습니다.config 와 수행을 리디렉션합니다.고 싶어한 피드백을 얻을 참조하는 경우 다른 사람과 비슷한 수행 한 SharePoint2007 과 모든 좋은 장소를 제공합니다.다시 나는 뭔가를 구현하는 가늠하지 않고 주요 변경 내용은 나중에 그려 넣어 최소한의 처리 부담에서 우리의 웹 서버에 있습니다.감사합니다!
해결책
Ive 구현 url 리다이렉션과 함께끼를 사용하는 HTTP 모듈은 경로입니다.나는 문서화된 코드를 사용하고 어떤 매개 변수는 일에 대한 최고 여기 나;
http://scaredpanda.com/2008/08/url-rewriting-with-sharepoint-moss-2007/
보고 알려주는 경우 이것은 당신과 당신이 어떤 질문이 있습니다.
업데이트: 링크 위에 더 이상 유효하지 않은,그래서 여기에서 텍스트의 페이지 내가 사용하는을 위한 URL 로 리디렉션합니다.
후에는 장난을 위해 조금은 그것이 우리 때문에 그들이 겪는 고통을 잠시와 함께하는 좋은 방법이다.나가 찾을 때에 예 웹사가 있었다 많은 사람들이 말하는 couldnt 수행 할 수 있습니다.그러나 결국은 실제로 가지고 가지 않은 많은 그것을 구현합니다.여기에는 HttpModule 는 내가 쓴 작업을 할 수 있습니다.
키 조각이다.app.BeginRequest+=new EventHandler(app_BeginRequest)는 단계는 앞에 요청할 수 있는 모듈을 리디렉션한다.
고 HttpContext.현재 있습니다.RewritePath(redirect,false);밀어 것입니다 필요한 헤더 n 은 앞으로도록 수 있습니다.페이지 방법을 이해하는 것입을 올바르게 게시다.
using System;
using System.Data;
using System.Data.SqlClient;
using System.Reflection;
using System.Collections;
using System.Text;
using System.Web;
using System.Web.Caching;
using System.Web.SessionState;
using System.Security.Cryptography;
using System.Configuration;
using System.Threading;
using System.IO;
using System.Security;
using System.Security.Principal;
namespace ScaredPanda
{
public sealed class RewriteHttpModule : IHttpModule
{
HttpApplication app = null;
///
/// Initializes the httpmodule
///
public void Init(HttpApplication httpapp)
{
this.app = httpapp;
this.app.BeginRequest += new EventHandler(app_BeginRequest);
}
public void app_BeginRequest(Object s, EventArgs e)
{
try
{
//determine if the income request is a url that we wish to rewrite.
//in this case we are looking for an extension-less request
string url = HttpContext.Current.Request.RawUrl.Trim();
if (url != string.Empty
&& url != "/"
&& !url.EndsWith("/pages")
&& !url.Contains(".aspx")
&& url.IndexOf("/", 1) == -1)
{
//this will build out the the new url that the user is redirected
//to ie pandas.aspx?pandaID=123
string redirect = ReturnRedirectUrl(url.Replace("/", ""));
//if you do a HttpContext.Current.RewritePath without the 'false' parameter,
//the receiving sharepoint page will not handle post backs correctly
//this is extremely useful in situations where users/admins will be doing a
//'site actions' event
HttpContext.Current.RewritePath(redirect, false);
}
}
catch (Exception ex)
{
//rubbish
}
}
}
}
다른 팁
가 있으로 봤을 대체 액세스 맵핑?
당신이 열려 지불하는 솔루션입니다.보라:
지> http://www.muhimbi.com/Products/SharePoint-URL-Shortener.aspx
의 수에 따라 리다이렉를 구현할 수 있습 HTTP 모듈을 명시)하는 방법에 대해 확인
를 사용하여 URL 재작성 기능을 합니다.(나는 그것을 믿는 IIS7 장)