Remove index.php from url in permalinks over IIS server (web.config)
I have a WP installation in its own folder (my-domain.com/site) and I'm trying that site works over my-domain.com. I'm not moving the installation files, actually I'm just giving to WP its own directory.
The WP installation is running over an IIS server. So I have a web.config file.
I've already done the steps that Wordpress Codex says:
- Change the site address to my-domain.com.
- Copy (not move) the index.php and MOVE the web.config, both to root directory.
- In index.php (root directory) I've changed this line:
require( dirname( __FILE__ ) . '/site/wp-blog-header.php' );
According WP Codex for Permalinks without mod_rewrite, in the permalinks settings (in dashboard) I set to: /index.php/%postname%/
. If I remove the index.php
part from the permalinks settings doesn't work anymore.
Right now my permalinks are working, but in this way: my-domain.com/index.php/page_example. I want to remove the "/index.php/" part from the url.
In my web.config I have:
?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
I've tried even add a clear/
before add the rule but without success.
Note: If I left the site address (URL) with: my-domain.com/site and remove the "/index.php/" part from permalinks settings, the permalinks works good like this: my-domain.com/page_example.
Any idea how to solve this? Maybe I'm missing some rules in the web.config
Topic iis permalinks Wordpress
Category Web