Come reindirizzare a radice dell'applicazione utilizzando il Rewrite Module IIS7 URL?
-
19-09-2019 - |
Domanda
ho provato:
1) Ho provato stringa vuota prima:
<action type="Redirect" url="" redirectType="Permanent" appendQueryString="false" />
Risultato:
HTTP 500.52 - URL Rewrite Module Error.
The substitution URL for the current action cannot be empty.
2) Forse dovrei omettere l'attributo url
:
<action type="Redirect" redirectType="Permanent" appendQueryString="false" />
Stesso risultato:
HTTP 500.52 - URL Rewrite Module Error.
The substitution URL for the current action cannot be empty.
3) Che cosa circa il modo in cui ASP.NET:
<action type="Redirect" url="~" redirectType="Permanent" appendQueryString="false" />
tenta di reindirizzare a {APP_ROOT}/~
.
4) Ultimo tentativo:
<action type="Redirect" url="/" redirectType="Permanent" appendQueryString="false" />
Come previsto, si reindirizza alla radice del server ...
Mi piacerebbe trovare qualche soluzione generica pulita. (Non posso usare qualche /myCurrentAppPath
concreta.)
Soluzione
Questo funziona meglio:
<action type="Redirect" url="." redirectType="Permanent" appendQueryString="false" />
Altri suggerimenti
Per il momento provare questo, non è pulito ma funziona:
<action type="Redirect" url="?" redirectType="Permanent" appendQueryString="false" />
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow