We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

web.config rules Wordpress Permalink RSS

7 replies

Last post Mar 16, 2021 05:51 PM by EcoIt

  • web.config rules Wordpress Permalink

    Aug 27, 2019 03:07 AM|3bdo|LINK

    wordpress site not showing inner pages, It show only home page and wordpress admin page. While click save changes in "Permalink Settings" it show "You should update your web.config now."

    web.config 

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
      <system.webServer>
        <rewrite>
          <rules>
    			<rule name="WordPress: http://test.com" patternSyntax="Wildcard">
    				<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"/>
    			</rule></rules>
        </rewrite>
      </system.webServer>
    </configuration>



  • Re: web.config rules Wordpress Permalink

    Aug 28, 2019 02:09 AM|Jalpa Panchal|LINK

    Hi,

    Add below code in your web.config file:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
        <system.webServer>
            <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>
            </rewrite>
            <staticContent>
                <remove fileExtension=".svg" />
                <mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
            </staticContent>
            <defaultDocument>
                <files>
                    <remove value="index.aspx" />
                    <add value="index.php" />
                </files>
            </defaultDocument>
        </system.webServer>
    </configuration>

    if you get 500 error then remove the  <defaultDocument> part from the config file.

    and make sure you enable iis CGI feature and your WordPress site have enough permission for the iis_iusrs and iusr. 

    Best Regards,

    Jalpa

    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
  • Re: web.config rules Wordpress Permalink

    Aug 29, 2019 12:55 PM|3bdo|LINK

    I have tried the method The problem still exists

  • Re: web.config rules Wordpress Permalink

    Aug 30, 2019 05:49 AM|Jalpa Panchal|LINK

    Hi,

    are you histed WordPress site as application or site? where did you out your web.config file? 

    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
  • Re: web.config rules Wordpress Permalink

    Aug 30, 2019 05:51 AM|Jalpa Panchal|LINK

    did you installed the url rewrite extension? 

    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
  • Re: web.config rules Wordpress Permalink

    Apr 16, 2020 04:51 AM|amin750|LINK

    What should be added for utf-8 characters?

    Jalpa Panchal

    Hi,

    Add below code in your web.config file:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
        <system.webServer>
            <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>
            </rewrite>
            <staticContent>
                <remove fileExtension=".svg" />
                <mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
            </staticContent>
            <defaultDocument>
                <files>
                    <remove value="index.aspx" />
                    <add value="index.php" />
                </files>
            </defaultDocument>
        </system.webServer>
    </configuration>

    if you get 500 error then remove the  <defaultDocument> part from the config file.

    and make sure you enable iis CGI feature and your WordPress site have enough permission for the iis_iusrs and iusr. 

    Best Regards,

    Jalpa

  • Re: web.config rules Wordpress Permalink

    Jan 21, 2021 05:52 AM|amin750|LINK

  • Re: web.config rules Wordpress Permalink

    Mar 16, 2021 05:51 PM|EcoIt|LINK

    Hi there,

    I'm facing same issue, can you let me know what action did you take? there are some on that link!

    Thanks!