views:

26

answers:

1

I know this question may have been asked before, but I have read hundreds of posts all over the Internets and nothing has worked...

I have a wordpress install (WP 3.0), running on MySQL and PHP 5.2.6.

I'm trying to get the permalinks to just be site.com/postname. When I set the permalinks in the settings to just be

/%postname%

It displays as I want it, but I get a 404 on every page (other than the home page).

When it's in this state, if I manually type in site.com/index.php/postname, I get the page, but all the links on the site are pointing to site.com/postname, leading to 404s...

I've been all round the houses on this one, and got in to several different situations. At one point, all the links were going to site.com/postname, and instead of 404'ing, they were all just displaying the home page content :S

Any help here would be appreciated.

Thanks!

+2  A: 

You need to do URL rewriting. This is usually done in the .htaccess file for your site. On IIS you need a third party plugin to provide this functionality.

Here is my .htaccess from my IIS/WP3 blog, were I host under /blog/ which you could remove from below:

php_value memory_limit 48M
Options +FollowSymlinks

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^blog/.* /blog/index.php [NC,L]
Simeon Pilgrim
You might find reading the .htaccess and mod-rewrite tags useful - http://stackoverflow.com/questions/tagged/.htaccess http://stackoverflow.com/questions/tagged/mod-rewrite
Simeon Pilgrim
Yeah, I've given that a go as well. I've currently got the ISAPI ReWriter plugin installed in WP, with a .htaccess file in the root. Currently same as yours, except rule is: RewriteRule ^/.* /index.php [NC,L]
Jaymz
I've also tried using the IIS7 URL Rewrite module... not sure if I'm doing something wrong though... I'm using it through web.config file, can't seem to get any combination of attempts to work properly though.
Jaymz
My hosted site is using Helicon Tech ISAPI_Rewrite v3, not sure how they have it configured, but it's running and it works when I use the above .htacess
Simeon Pilgrim
Do you know if that's with IIS7? I've tried with the above .htaccess in the root directory, and removed the 'blog' from both parts of the RewriteRule, but I'm just in the situation of /pagename leading to 404, and only /index.php/pagename working...
Jaymz
After digging it appears that the servers are IIS6 not 7.
Simeon Pilgrim
OK, I've managed to get it working with some combination of settings... can't tell you exactly what was wrong, as I've completely lost track. Marking this as an answer, as it's the right .htaccess entry (with 'blog' removed from the RewriteRule, as I'm in the root directory). Thanks everyone.
Jaymz