Installed on Windows 10 is, IIS 10, IIS Express 10, Visual Studio Community 2017 and PHP Tools (without paid debugging activated).
Wordpress has been dropped into an empty Visual Studio Community 2017 PHP project. A MySQL database and user was created in PHPMyAdmin and the credentials used during the Wordpress install.
Wordpress runs; however, index.php appears in the permalink structure.
I’ve been using VS and Webmatrix for years and I have never seen this before on my machines. This doesn’t happen in Webmatrix. Although, I’ve not built a Wordpress site in Visual Studio Community 2017 until now.
Research indicates the Rewrite Rule needs adding to the web.config file – it’s already there and the URL Rewrite Module is installed.
When making changes to the web.config file, I noticed the changes weren’t making any difference. The web.config file is not being recognised by VS.
The Wordpress permalinks, can be custom changed in wp-admin to remove index.php. But this doesn’t get to the root of the problem which is index.php showing in the URLs.
Questions:
- How do I remove index.php from the Wordpress URLs?
- Why is the web.config file is not being recognised by VS? How to I change this please?
- If VS is using a config file saved somewhere in the solution, can I add the Rewrite Rule to it or get VS to use the root web.config file I added instead?
- Does the fact Wordpress permalinks can be custom changed mean re-write is configured somewhere else and actually working, so the index.php issue is down to something else?
- In properties, I can choose web servers - built in web server, IIS Express and Custom web server. I thought VS used IIS Express, so why is there a built-in web server option as well as IIS Express?
Any enlightenment would be appreciated - thank you.
Edit: I have just found this extract from a post by @Cathy Zou here.
"<rewrites> section must have IIS's URL rewrite module support. From your URL, it seem that, you application running with built-in IIS Express in VS, Which does not support URL rewrite"
Does this mean I'm wasting my time? I'm never going to remove the index.php in the URLs when I'm using VS and the built in web server?