2017-09-05 16 views
0

http要求に対して301リダイレクトを設定する必要がありますが、見つけた部分を入れて希望の結果を達成できませんでした。私はこのコンセプトに精通していないので、タイトルは誤解を招くものではないことを願っています。URLリライトを使用してhttpをhttpsにリダイレクトする方法

今私は、これらの条件

https://example.com --->https://www.example.com

を設定する必要があり、他のmicromanagesルール

と一緒にこの

<rule name="Redirect to https" enabled="true" stopProcessing="true"> 
      <match url="(.*)" /> 
      <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> 
      <add input="{HTTPS}" pattern="off" /> 
      <add input="{HTTP_HOST}" pattern="^www.example.com$" negate="true" /> 
      </conditions> 
      <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" /> 

をしようとしています

http://example.com --->https://www.example.com

http://www.example.com --->https://www.example.com

https://example.com/abc/def ---->https://www.example.com/abc/def

http://example.com/abc/def ---->https://www.example.com/abc/def

http://www.example.com/abd/def --->https://www.example.com/abc/def

基本的に、http以外の非リクエストはすべて "https://www ..."フォーマット。

現在、ルールIセットはhttp://example.comフォーマットでは機能していません。

私はこれがリダイレクトかリライトかどうかはわかりませんが、私たちのSEOカウンセラーは301リダイレクトを主張しています。

このルールはどのように設定できますか?この規則は、あなたのために働く必要があります

答えて

1

<rule name="Redirect to https" enabled="true" stopProcessing="true"> 
    <match url="(.*)" /> 
    <conditions logicalGrouping="MatchAny" trackAllCaptures="false"> 
    <add input="{HTTPS}" pattern="off" /> 
    <add input="{HTTP_HOST}" pattern="^www.example.com$" negate="true" /> 
    </conditions> 
    <action type="Redirect" url="https://www.example.com/{R:1}" /> 
</rule> 

私は条件がMatchAnyにgrouppingとリダイレクト結果URLにwww.example.com を使用して変更する

関連する問題