Hi there,
Since this topic: http://wordpress.org/support/topic/wp-30-preview-and-save-draft-functions-not-working is closed for some reason, I will continue here since this problem is far from solved!
Basically, the generated preview url for drafts uses the site address url and not the wordpress address url and is therefore not working and giving a 404 error page.
My url setup:
- WordPress is installed in a root subfolder called 'blog' on my main domain A.
- I have a second domain name B that points to my main domain A.
- In my General Settings 'WordPress Address (URL)' has the following value: http://www.domain-a.com/blog
- In my General Settings 'Site Address (URL)' has the following value: http://www.domain-b.com
- I use a .htaccess file in my root to rewrite the url like this:
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/blog/.*$
RewriteRule ^(.*)$ /blog/$1
All of the above works perfectly! Except for one little thing; previewing draft posts...
The generated url when clicking 'preview draft' is as follows:
http://www.domain-b.com/?p=2187&preview=true
which results in a 404 'page not found' error page.
When I manually change the url address into:
http://www.domain-a.com/blog/?p=2187&preview=true
The draft preview shows up perfectly!
I can't expect from all the users of my website to manually change this address all the time, so I was wundering if there is a solution for this any time soon?
I read this article about manually rewriting the preview url:
Rewrite wordpress preview URL using .htaccess
but that's only useful if the generated preview url allready consists of the WordPress Address URL and not the Site Address URL.
Does anyone have a fix or workaround for this annoying problem?
Any help is appreciated!
Cheers