Markus "guruz" Goetz

[ index | hardware | projects and coding | p300 | blog | contact ]




Januar 26, 2008 at 3:04 pm.
Abgelegt unter: Meta,Software,Web
guruz @ 3:04 pm

Properly verifying your site at Google Webmaster Tools when using WordPress

The GWT will check if your site returns a HTTP 404 (=not found) for a file that should not exist. This has to be done because otherwise it would not make sense to have to check if a file google_blabla.html exists because there may be sites where every request returns a HTTP 200 (=everything OK).

With my current WordPress setup and theme this lead to some problems, because every URL exists when using permalinks (at least for me). But fear not, you can modify the Apache config lines for the permanlinks to:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !noexist_YADAYADAYADA.html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

This basically means that rewriting will only be done if the file is not named noexist_YADAYADAYADA.html. And since this file really does not exist, your web server will return a HTTP 404. To see what you need to enter for YADAYADAYADA.html check your access log when Google is trying to verify your site.

Hope that helps ;)

Willst du automatisch ueber neue Artikel informiert werden? Dann subscribe dich via E-Mail oder via RSS


Google Webmaster Tools
Google Alerts um zu erkennen ob die eigene Webseite gehackt ist
Ich mags…

Comment Feed

Keine Kommentare

Leider ist die Kommentarfunktion zur Zeit deaktiviert.