【问题标题】:How to Converting web.config file to .htaccess如何将 web.config 文件转换为 .htaccess
【发布时间】:2017-12-01 07:42:50
【问题描述】:

谁能帮我把这个web.config文件转换成.htaccess

<rules>    
      <rule name="Rewrite to index" stopProcessing="true">
           <match url="^(.+)$" ignoreCase="true" />
            <conditions>
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
            </conditions>
           <action type="Rewrite" url="index.php?permalink={R:1}" />
      </rule>
</rules>

【问题讨论】:

    标签: php .htaccess url-rewriting web-config


    【解决方案1】:

    这看起来像是标准的前端控制器模式。 IE。在内部将所有未映射到现有文件或目录的请求重写为 index.php?permalink=&lt;URL&gt;

    所以,.htaccess 中的类似内容:

    RewriteEngine On
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule (.*) index.php?permalink=$1 [L]
    

    【讨论】:

      猜你喜欢
      • 2017-01-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多