WordPress.org

Ready to get started?Download WordPress

Forums

URL Rewrite IIS Module leading to Home Page Error (16 posts)

  1. alisyme
    Member
    Posted 1 year ago #

    Hi guys ('n' gals)

    I've used this rule for a few sites (changing the domain of course) and while it works perfectly for tidying up my URLs on one site, on two others it leads to the homepage / leading to a 404, whereas /index.php works perfectly.

    Can anyone tell me how to prevent the rule from messing up the homepage?

    <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>

    Many thanks

    Ali

  2. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    Set the permalink in you admin dashboard and save.

  3. alisyme
    Member
    Posted 1 year ago #

    Sorry it's a bit more complicated than that I'm afraid

  4. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    Please explain.

  5. alisyme
    Member
    Posted 1 year ago #

    The URL rewrite rule works on one site out of three, so there must be something with that site that makes it work or something wrong with the other two to make it not work.

  6. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    Is one in root host location?

  7. alisyme
    Member
    Posted 1 year ago #

    They are all in the same location relative to the different websites

  8. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    Each on different hosts?

  9. alisyme
    Member
    Posted 1 year ago #

    Each one is in the root directory, which is C:\Inetpub\vhosts\mydomain.com\httpdocs\

    So it can't be a location issue.

    Ali

  10. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    False.

  11. alisyme
    Member
    Posted 1 year ago #

    Do try and explain?

    How can it be a location issue?

  12. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    hierarchy of web.config

  13. alisyme
    Member
    Posted 1 year ago #

    Can you elaborate on that?

    Are you saying the web.config file should be somewhere else for two of the sites but not for one?

    Ali

  14. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    I am saying that there is a quite known hierarchy of web.config and it's location is pertinent.

  15. alisyme
    Member
    Posted 1 year ago #

    Where would you place your web.config then?

  16. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    I would consult with my webhost and review this link and it's links.

Topic Closed

This topic has been closed to new replies.

About this Topic