Okay, I’m adding some details because I really need to fix this.
I am running my WordPress installation with IIS installed on the server. I think the cause of my pretty URLs not working for my posts is because I am running it on IIS and thus .htaccess is not used.
My Permalinks settings is like this:
/blog/%postname%
I currently have this in my web.config:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<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>
</system.webServer>
</configuration>
I created a Page called “Blog” which is at “http://www.mysite.com/blog/” and in that template I use the loop to grab all the posts. However, user get_permalink or the_permalink returns URLs as “http://www.mysite.com/?post=lorem-ipsum” and the content shows fine. But if I type “http://www.mysite.com/blog/lorem-ipsum”, the content still shows perfectly, but this URL is not returned by the permalinks functions. Is there a way to precise that I want the pretty URL to be returned in my blog list?
Oh well, I worked a temporary workaround because I couldn’t find how to fix it.
I used a custom function call in my template which does the following:
function get_blog_permalink()
{
return qtrans_convertURL(str_replace("?post=", "blog/", get_permalink()));
}
So far, all links are valid and show correctly, I guess my fix is good enought…