簡體   English   中英

asp.net網站中的wordpress網址重寫不適用於類別和標簽

[英]wordpress url rewriting in asp.net website not work for categories and tags

我在我的asp.net網站上使用wordpress引擎進行博客。
我在設置中使用的網址重寫如/ posts /%post_id%/。 除了類別和標簽外,每件事情都正常。
我將基類別設置為'category',將base標記設置為'tag'。 類別網址顯示為“ / blog / category /(something)/”,但會引發404錯誤。
Wordpress web.config是這樣的:

<rewrite>
<rules>
    <rule name="Main Rule" stopProcessing="true">
        <match url=".*" />
        <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
        </conditions>
        <action type="Rewrite" url="index.php" />
    </rule>
</rules>

這是解決方案:
在wp-config.php文件中添加以下代碼:

if (isset($_SERVER['UNENCODED_URL']))
     $_SERVER['REQUEST_URI'] = $_SERVER['UNENCODED_URL'];

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM