• After migrating to windows sever, following web.config uploaded.

    Error: Clicking any link redirects to home page.

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
      <system.webServer>
        <rewrite>
          <rules>
            <rule name="wordpress" 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>
      </system.webServer>
    </configuration>

    Please advise correct web.config. (Not multi-site). Unsuccessfully tried examples from various websites. I suppose some redirection code is missing in the web.config above.

    website: https://dainikpurvoday.in/news

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator bcworkz

    (@bcworkz)

    If you are getting to the home page, the server has done its part. Apparently WP is not processing permalinks properly. Please visit https://dainikpurvoday.in/news/wp-admin/options-permalink.php and verify your permalink settings are correct. Doing so will also cause the WP rewrite rules to be regenerated.

    Thread Starter puspaltamuli

    (@puspaltamuli)

    I reset the permalinks to numeric and
    then to postname (https://dainikpurvoday.in/news/sample-post/).
    But the web.config file does not change. File read/write permissions are all there. Could it be that wordpress is not detecting windows since we migrated from linux? How to trouble shoot?

    Moderator bcworkz

    (@bcworkz)

    web.config looks OK AFAICT. All it does is send requests to index.php when the request does not match any file system files or folders, which is typical of a permalink request. It would be hard for WP to not detect Windows, it does so by the presence of the web.config file.

    Try hooking the “request” filter and in your callback print_r() the passed array of query vars. For a single post request the output at the top of the page should be something like Array ( [page] => [name] => post-slug-here ). With some themes you may need to view page source to see the output. If you see something else, such as an empty array, the problem is in the WP parser. If the output is as expected, the problem lies beyond the parser.

    Thread Starter puspaltamuli

    (@puspaltamuli)

    We dont know how implement the above steps. Is there a simpler way?

    Moderator bcworkz

    (@bcworkz)

    It could be a plugin conflict or faulty theme. Try deactivating all plugins and switching to a twenty* theme. Visit the permalinks settings screen again. Afterwards, permalinks to posts should work correctly. Restore your theme and plugins, one at a time. Revisit permalinks settings after each step, then test for link functionality. When it again fails, the last activated module is the cause.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Migrating to Windows server’ is closed to new replies.