I’m getting the dreaded “No Input File Specified” error when using pretty permalinks, but I think it’s a WordPress problem, not a rewrite module problem. I’m on IIS7 and WP 3.4.2. The pretty permalink is:
http://www.mydomain.com/blog/2012/09/20/post-name/
and this is correctly rewriting to:
http://www.mydomain.com/blog/index.php/2012/09/20/post-name/
I think the rewrite is correct because when I go to this latter url manually, I still get the error. So I think the problem lies in WordPress. For completeness, though, here’s the rewrite rule:
<rule name="Main Rule" stopProcessing="true"> <match url="^blog/(.+)" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="/blog/index.php/{R:1}" /> </rule>
There are a lot of posts on this issue on SO, but they all seem to be rewrite issues, so I don’t think this is a duplicate of any question where the problem is the one I’m having.
Well, it was a rewrite problem, sort of. In the pattern above, I didn’t take into account that the site is on a shared host, and
/blogis actually pointing to\subfolder\blog. Changing it as follows fixed it:This isn’t ideal, because I had to hardcode the name of the subfolder, but for now, I’ll take it.