skip to Main Content

I have installed WordPress on my local machine – to test a few Woocommerce sites.

I’m running Windows 10, with IIS – and have installed PHPv7.3

I have setup my hosts file to point to my local IIS webserver:

127.0.0.1       localwwl.co.uk

The home page of WordPress comes up, and I can navigate into the control panel etc – but when I visit my local woocommerce site, and click on a product, I get a 404 not found error:

Requested URL      http://localwwl.co.uk:80/product/
Physical Path      C:inetpubwwwrootlocalwwlproduct

Similarly, if I visit the store (which has a “shop” added to the url) I get the same 404 error:

Requested URL      http://localwwl.co.uk:80/shop
Physical Path      C:inetpubwwwrootlocalwwlshop

I know the physical file paths don’t exist, but WordPress should be taking the URLs and retrieving the required info from the database.

Is there something within WordPress or IIS, that I need to set, to make sure that the requested URL maps properly to the right area on the local drive, and under wordpress’s control?

The Permalinks are setup exactly as they are on my live site – and I’m using a local copy of the live database.

Thanks for any help,

Mark

2

Answers


  1. Chosen as BEST ANSWER

    For anyone else with this issue - I found an answer.

    The following needs to be added to your web.config file (like .htaccess, but for Windows):

    <rules>
    <rule name="wordpress" 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>
    

    Thanks for the other suggestions and comments.

    Mark


    • Please just go in backend setting>permalink and press the save changes button only and I think it would be working after that.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search