0

** 以下のコードを試した後、私のウェブサイトのリンクを www.mydomain.com/index.php?do=/blog から www.mydomain.com/blog に変更するように書き換えルールを変更しましたが、できません。たとえば、www.mydomain.com/blog に移動したい場合、www.mydomain.com で立ち往生した場合、同じルート ページにリダイレクトすることを意味します。

これに対してどのような変更を加える必要があるか教えてください。私は初心者です

私のコードは**です

`<rule name="Redirect index.php" stopProcessing="true">
    <match url="index\.php/(.*)" />
    <action type="Redirect" url="{R:1}" appendQueryString="false" />
  </rule>
  <rule name="Rewrite index.php">
    <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/{R:1}" />
  </rule>
</rules>`
4

2 に答える 2

0
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
          <rules>
            <rule name="Imported Rule 1">
              <match url="^file/pic/photo/([0-9]+)/([0-9]+)/([A-Za-z0-9]{32}+)\-(.*?)_([0-9]*?)\.(.*)$" ignoreCase="false" />
              <action type="Rewrite" url="file/pic/photo/{R:1}/{R:2}/{R:3}_{R:5}.{R:6}" />
            </rule>
            <rule name="Imported Rule 2">
              <match url="^file/pic/photo/([0-9]+)/([0-9]+)/([A-Za-z0-9]{32}+)\-(.*?)\.(.*)$" ignoreCase="false" />
              <action type="Rewrite" url="file/pic/photo/{R:1}/{R:2}/{R:3}.{R:5}" />
            </rule>
            <rule name="Imported Rule 3">
              <match url="^(.*)$" ignoreCase="false" />
              <conditions>
                <add input="{HTTP_HOST}" pattern="^www\." ignoreCase="false" negate="true" />
              </conditions>
              <action type="Redirect" redirectType="Found" url="http://www.%" />
            </rule>
            <rule name="Imported Rule 4" stopProcessing="true">
              <match url="[^/]$" ignoreCase="false" />
              <conditions>
                <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
              </conditions>
              <action type="Redirect" redirectType="Permanent" url="{URL}/" />
            </rule>
            <rule name="Imported Rule 5">
              <match url="^(.*)" ignoreCase="false" />
              <conditions>
                <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
              </conditions>
              <action type="Rewrite" url="index.php?do=/{R:1}" appendQueryString="false" />
            </rule>
            <rule name="Imported Rule 6">
              <match url="^file/pic/photo/(.*)\.(.*)$" ignoreCase="false" />
              <action type="Rewrite" url="static/image.php?file={R:1}&amp;ext={R:2}" appendQueryString="false" />
            </rule>
          </rules>
        </rewrite>
    </system.webServer>
</configuration>
于 2014-12-28T19:23:48.720 に答える
0

書き換えに関するこのフォーラムの投稿に基づいて.htaccess、次のように書き換える必要があります。

index.php?do=/{R:1}

?do=真ん中の部分が欠けています。

于 2013-05-01T00:09:14.323 に答える