Server: WP 2.1.2, Apcahe2 with mod_rewrite enabled and running virtual hosts.
WordPress is installed in /var/www/example.com/blog
Wordpress Address – http://www.example.com/blog
Blog Address – http://www.example.com/blog (also)
So our site file structure looks like this under /var/www/example.com/:
index.php (the main file)
blog/(all wordpress files here)
In the root index.php file of our site (not wordpress) we include wordpress wp-blog-header.php file to be able to use wordpress functions throughout our site files in /var/www/example.com. So we have this in our root index.php file:
And it works just fine. We are able to use all wordpress built-in functions and use it as a CMS for our site. And when we go to http://www.example.com/blog it displays our blog custom theme files. Perfect!
We have also enabled pretty permalinks and written the respective .htaccess file under the blog/ directory. This is also working just fine, so when we put http://www.example.com/blog/2007/06/post-title it goes to the respective single page. No problem so far!
Our site is working ok… when is seen on a browser. But when search engines like google try to index our pages, they can only do that for our site root index.php file and for the files under blog/.
For all other site directories under /var/www/example.com a 404 error code is returned in the headers (although a normal browser displays the pages correctly).
When using those tools available in the Internet (ex: http://gsitecrawler.com/tools/Server-Status.aspx) to see what’s in the headers we see a 404 error. For example if we put http://www.example.com/blog or http://www.example.com, it returns 200/OK but if we put http://www.example.com/services it returns 404 and google does not indexes it.
In the index.php files on those directories we also include wordpress like this:
The strange thing is that if we disable pretty permalinks and switch to the default (…/?p=23) that pages get indexed and no 404 error is returned. And even if we disable mod_rewrite in Apache, just the simple fact of activating permalinks in WP, results in all those other pages returning 404 in the headers again.
We are using lynx to see this strange behaviour happening.
Has anyone experienced similar problem?
If you need more details just let me know.