WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

closed as too localized by toscho Jan 2 '13 at 23:10

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

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

share|improve this answer
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.