I set permanent link as http://site.com/%postname%/. I'm talking about this type of pages: http://codex.wordpress.org/Pages_Screen. All first level pages work fine. But subpages don't.

For the first level page I get url like this: http://site.com/page/. For the second level page - http://site.com/page/subpage/.

If I use permanent link http://site.com/?p=123 or http://site.com/2012/02/29/sample-post/, subpage works fine then.

How does make it work with http://site.com/%postname%/ mask?


# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress


I found the reason. It is a post_type field in the wp_posts. But I cannot find out where this field is saved?

  • Just a side note that since you are developing locally your this is probably just an environment issue. You could have completely different results when putting this on the live server. Don't waste too much time on getting permalinks to work locally. – developdaly Dec 3 '12 at 14:13

You're wanting to use "Pretty Permalinks" and in order to do so you need to have some form of rewrite documentation present. The easiest and most common is a .htaccess file to hold the rewrite rules.

Do you have an .htaccess present for the site?

If you do not, you can reference the WordPress Codex here: http://codex.wordpress.org/Using_Permalinks#Where.27s_my_.htaccess_file.3F

  • yes, I have. Wordpess doesn't do such directs automatically? And how this rewrite looks like then? – Anthony Feb 29 '12 at 16:24
  • @Anthony I'm not sure what you're asking. Are you using this on your local machine or is it hosted with someone? – The Z Man Mar 1 '12 at 2:54
  • It's a local machine, LAMP. Wordpress recommends a pretty links with a full date. If I do it without date I got 404 error. As understand I should do some rewrite rule in the htaccess. Which one then? – Anthony Mar 1 '12 at 7:45
  • Can you post your .htaccess file contents? Also, after making changes to the .htaccess file you may need to restart your LAMP server in order for the mod_rewrite to pickup the .htaccess changes. – The Z Man Mar 1 '12 at 17:53
  • Added to post. By the way I've tried to install empty WP and subpages work fine. After I added new theme from templatemonster I get this problem. I don't know how to identify which is plugin relay on this. – Anthony Mar 1 '12 at 21:11

Not the answer you're looking for? Browse other questions tagged or ask your own question.