Preview posts returns 404

It’s a large WordPress multisite installation, using subfolders for the individual blogs, not domains. We are running version 3.1, and preview posts doesn’t work. When I press preview I get the 404.php page. Nothing in the log files that caught my eye, all plugins disabled.
Sometimes I get an error message about insufficient rights when I press preview.
I’m running out of ideas to try.

Related posts

Leave a Reply

3 comments

  1. When posts are being previewed WordPress appends a query string to the end of the url.

    The permalink settings are not applied until the post is published. While the post is in draft status the preview link will be yourdomain.com/?p=1119&preview=true where p=xxxx is the post id number.

    Once the post is published and you make changes and want to preview, the preview link will be

    yourdomain.com/%year%/%postname%/?preview=true&preview_id=1119&preview_nonce=6xcade32bz

    Where %year%/%postname%/ is your permalink settings and preview_nonce is a security feature to prevent others from previewing your posts.

    Can you give us the URL that the preview post link is going to. Then when clicked give us the url that is in the browser window. This will determine where the problem is.

    You can also try to manually enter the preview link into the browser to see if that works.

  2. Make sure that the 2 URLs in Settings>General both either start with www or that they both don’t have the www in the url – ie they should be consistent.

  3. Please go to the file template-loader.php in wp-include folder and comments the line number 7 which should be do_action(‘template_redirect’); so please make it like this

    //do_action(‘template_redirect’);

    and it will sort out preview post issue in multisite setup.