2013-03-07 107 views
0

** 我更改了我的重寫規則,以將我的網站鏈接從www.mydomain.com/index.php?do=/blog更改爲www.mydomain.com/blog這個當我嘗試下面的代碼,它不會讓我改變任何頁面,就像我想去www.mydomain.com/blog,我只是在www.mydomain.com被困住,意味着重定向到我的同一個根目錄頁面,重寫規則在phpfox中的IIS中無法正常工作

我應該爲此做些什麼改變,請大家幫忙。我是一個newbei

我的代碼是**

`<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>` 
+0

的可能重複[是否有任何phpfox選項可以設置搜索引擎友好的URL?](http://stackoverflow.com/questions/18739871/is-there-any-option-in-phpfox-to-設置SEO友好的URL) – 2013-09-21 10:04:23

回答

0

基於this forum post.htaccess重寫,你需要重寫:

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

你缺少在該​​部分中間。

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>