2011-12-22 13 views
1

web.configを使用してURLを書き直そうとしていますが、私はそれについて知識がありませんので、どうすれば助けてくれますか?以下は私のweb.configコードは次のとおりです。URL web.configを使用して書き換えを行います

<?xml version="1.0" encoding="UTF-8"?> 
<configuration> 
    <system.webServer> 
    <rewrite> 
     <rules> 
       <rule name="xyz" patternSyntax="Wildcard"> 
        <match url="*"/> 
         <conditions> 
          <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/> 
          <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/> 
         </conditions> 
        <action type="Rewrite" url="index.php"/> 
       </rule></rules> 
    </rewrite> 
    </system.webServer> 
</configuration> 

私のようなURLを持っている:私はこのアクションを実行するにはどうすればよいhttp://www.example.com/manage_testORhttp://www.example.com/manage_test.html

:私はそれのようになりたいhttp://www.example.com/?file_name=manage_test

を?

ありがとうございます。

答えて

0

この書き換えルールがあなたに、この書き換えを行います。

<rule name="xyz" stopProcessing="true"> 
    <match url=".*" /> 
    <conditions> 
     <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> 
     <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> 
    </conditions> 
    <action type="Rewrite" url="index.php?file_name={R:0}" /> 
</rule> 

このURL http://www.example.com/manage_testhttp://www.example.com/?file_name=manage_testとなど

に書き換えられます
関連する問題