2

テストを行った後、ASP.NET Web サイトを完成させました。

http://www.urlrewriting.net/の UrlRewritingNet dll を使用しています。

次に、サーバーをアップロードするために公開しました(Windows 7、IIS 7がインストールされています)。サイトの URL を入力すると、404 - 見つかりませんというエラーが表示されます。これは、サーバー側の設定が欠落しているか、正しくないためです。しかし、私は正確に何をすべきかわかりません。

何度も検索しましたが、私の問題に近いものは見つかりませんでした。

最後のチャンスのために、私はここにいます。手伝ってくれますか?

私の web.config コンテンツは次のとおりです。

<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->

<configuration>
    <configSections>
        <section name="urlrewritingnet" requirePermission="false" type="UrlRewritingNet.Configuration.UrlRewriteSection, UrlRewritingNet.UrlRewriter"/>
    </configSections>

<system.web>
        <httpModules>
            <add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter"/>
        </httpModules>

        <compilation debug="true" targetFramework="4.0"/>
    </system.web>

    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"/>

        <handlers>
            <remove name="PageHandlerFactory-ISAPI-4.0_32bit"/>

            <add name="PageHandlerFactory-ISAPI-4.0_32bit" path="*.aspx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0"/>

            <add name="reww" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" preCondition="classicMode,runtimeVersionv4.0,bitness32"/>

            <add name="rewwibu" path="*.ibu" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv4.0,bitness32"/>
        </handlers>

        <validation validateIntegratedModeConfiguration="false"/>
    </system.webServer>

    <urlrewritingnet configSource="ExternalRewrite.config"/>
</configuration>

これは私の新しい Web.Config ファイルです:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.web>
        <compilation debug="true" targetFramework="4.0" />
    </system.web>
    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true" />
        <validation validateIntegratedModeConfiguration="false" />
        <rewrite>
            <rules>
                <rule name="GoAnasayfa">
                    <match url="^([_0-9a-z-]+)/Anasayfa.ibu" ignoreCase="false" />
                    <action type="Rewrite" url="Default.aspx?lang={R:1}" appendQueryString="false" />
                </rule>
                <rule name="GoIletisim">
                    <match url="^([_0-9a-z-]+)/Iletisim.ibu" ignoreCase="false" />
                    <action type="Rewrite" url="Contact.aspx?lang={R:1}" />
                </rule>
                <rule name="GoDereceProgramlari">
                    <match url="^([_0-9a-z-]+)/DereceProgramlari/([_0-9a-z-]+).ibu" ignoreCase="false" />
                    <action type="Rewrite" url="DegreePrograms.aspx?lang={R:1}&amp;derece={R:2}" />
                </rule>
                <rule name="GoOgrenci">
                    <match url="^([_0-9a-z-]+)/Ogrenci.ibu" ignoreCase="false" />
                    <action type="Rewrite" url="Ogrenci.aspx?lang={R:1}" />
                </rule>
                <rule name="GoKatalog">
                    <match url="^([_0-9a-z-]+)/([0-9]+)/([0-9]+)/([0-9])/Katalog.ibu" ignoreCase="false" />
                    <action type="Rewrite" url="Catalog.aspx?lang={R:1}&amp;opID={R:2}&amp;pmID={R:3}&amp;oid={R:4}" />
                </rule>
                <rule name="GoDersDetay">
                    <match url="^([_0-9a-z-]+)/([0-9]+)/([0-9]+)/([0-9])/([0-9])/DersAyrintilari.ibu" ignoreCase="false" />
                    <action type="Rewrite" url="CourseDetail.aspx?lang={R:1}&amp;opID={R:2}&amp;pmID={R:3}&amp;DersID={R:4}&amp;dersKodu={R:5}" />
                </rule>
                <rule name="GoLLPKoordinatorleri">
                    <match url="^([_0-9a-z-]+)/LLPKoordinatorleri.ibu" ignoreCase="false" />
                    <action type="Rewrite" url="Coordinators.aspx?lang={R:1}" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

Web アドレスを入力すると、アドレス バーに次のような lang パラメータが表示されます。

http://somedomain.com/tr-TR/Anasayfa.ibu?lang=tr-tr&lang=tr-tr&lang=tr-tr&lang=tr-tr&lang=tr-tr&lang=tr-tr&lang=tr-tr&lang=tr-tr&lang=tr-tr&lang=tr-tr&lang=tr-tr&lang=tr-tr&lang=tr-tr&lang=tr-tr&lang=tr-tr&lang=tr-tr&lang=tr-tr&lang=tr-tr&lang=tr-tr....

すると、ブラウザにエラー メッセージが表示されます。

無効なリダイレクト URL

4

2 に答える 2

10

追加してみてください:

<add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter"/>
<remove name="Session"/>
<add name="Session" type="System.Web.SessionState.SessionStateModule"/>

下のweb.configに

<configuration>
  ...
  <system.webServer>
    ... 
    <modules>
      <!-- add here -->
    </modules>
  </system.webServer>
  ...
</configuration>
于 2013-10-15T08:17:47.407 に答える
1

Microsoft の URL 書き換えモジュールを使用しないのはなぜですか?
http://www.iis.net/learn/extensions/url-rewrite-module/using-the-url-rewrite-module

システムのセットアップに基づいて、正しいバージョンをインストールしてください。次に、次のように書き換えルールの作成に進むことができます:
http://www.iis.net/learn/extensions/url-rewrite-module/creating-rewrite-rules-for-the-url-rewrite-module

于 2013-05-29T12:17:06.657 に答える