-1

我有一个 godaddy (windows) 托管帐户,我想重定向:

www.example.com/folder/somewww.example.com/folder/some.html

我尝试添加此 Web.config 文件,但找不到为重定向 html 添加什么规则

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="Add www" stopProcessing="true">
          <match url=".*" ignoreCase="true" />
          <conditions logicalGrouping="MatchAll">
            <add input="{HTTP_HOST}" negate="true" pattern="^www\.(.+)$" />
            <add input="{HTTP_HOST}" negate="true" pattern="^[^.]*dav.*" />
          </conditions>
          <action type="Redirect" url="http://www.{HTTP_HOST}/{R:0}" appendQueryString="true" redirectType="Permanent" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>
4

1 回答 1

0

尝试在您的 .htaccess 文件中使用以下代码

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html
于 2013-05-14T13:29:59.330 回答