7

denedim:IIS7 URL Yeniden Yazma Modülü'nü kullanarak uygulama köküne nasıl yönlendirme yapılır?

1) İlk boş dize çalıştı:

<action type="Redirect" url="" redirectType="Permanent" appendQueryString="false" /> 

Sonuç:

<action type="Redirect" redirectType="Permanent" appendQueryString="false" /> 
:

HTTP 500.52 - URL Rewrite Module Error. 
The substitution URL for the current action cannot be empty. 

2) Belki url niteliğini atlamalısınız

Aynı sonuc:

HTTP 500.52 - URL Rewrite Module Error. 
The substitution URL for the current action cannot be empty. 

3) Ne ASP.NET yol hakkında:

<action type="Redirect" url="~" redirectType="Permanent" appendQueryString="false" /> 

Denemeleri {APP_ROOT}/~ yönlendirmek için.

4) Son deneme:

Beklendiği gibi
<action type="Redirect" url="/" redirectType="Permanent" appendQueryString="false" /> 

, bu sunucunun kök yönlendirir ... Bazı temiz jenerik çözüm bulmak istiyoruz

. (. Bazı somut /myCurrentAppPath kullanamazsınız)

cevap

5

Bu daha iyi çalışır:

<action type="Redirect" url="." redirectType="Permanent" appendQueryString="false" /> 
+0

+1 Ok. Teşekkür ederim. –

2

Şimdilik bu deneyin, temiz değil ama çalışır:

<action type="Redirect" url="?" redirectType="Permanent" appendQueryString="false" /> 
+0

teşekkür ederiz! Daha iyi bir çözüm bulursanız bana bildirin :) –

İlgili konular