2012-04-25 22 views
0

非aspxサイトに対して書き換えルールを実行しようとしています。それはただのhtmlファイルです。IIS7書き換えルールが機能しない

これは私が現在web.configに持っているものです。私はさまざまなルールを試してきました。

<?xml version="1.0" encoding="UTF-8"?> 

    <rewrite> 
     <rules> 
      <rule name="Redirect domain.com to www" patternSyntax="Wildcard" stopProcessing="true"> 
       <match url="*" /> 
       <conditions> 
        <add input="{HTTP_HOST}" pattern="eyeswidewhat.net" /> 
       </conditions> 
       <action type="Redirect" url="http://www.eyeswidewhat.net/{R:0}" /> 
      </rule> 
     </rules> 
    </rewrite> 

答えて

0

これを試してください。これはwww以外のものをwwwにリダイレクトします。

<?xml version="1.0" encoding="utf-8"?> 
<configuration> 
<system.webServer> 
    <rewrite> 
     <rules> 
      <rule name="RedirectToWWW" stopProcessing="false"> 
       <match url=".*" /> 
       <conditions> 
        <add input="{HTTP_HOST}" pattern="^eyeswidewhat\.net$" /> 
       </conditions> 
       <action type="Redirect" url="http://www.eyeswidewhat.net/{R:0}" /> 
      </rule> 
     </rules> 
    </rewrite> 
    </system.webServer> 
</configuration> 
関連する問題