Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Google Verification methods
#1
Hello,

since I use fancy urls, Google cannot recognize the file googlexxxxxxxx.html in my root any more, which is needed for Google Webmaster Tools site verification.

Is there a way to give Google that file, which seems to need the .html ending?

Another way would be to add a meta tag into the index file, like
<meta name="google-site-verification" content="..." />

But: how can I manage to do that (only in the index file)?

Thank you for your help!
Reply
#2
I believe the google analytics plugin does this, the newer one.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#3
(2014-10-15, 20:07:13)Hypertexter Wrote: since I use fancy urls, Google cannot recognize the file googlexxxxxxxx.html in my root any more, which is needed for Google Webmaster Tools site verification.

Is there a way to give Google that file, which seems to need the .html ending?

I have just checked one of my GS sites (fancy URLs, default GS .htaccess) where I have a google*.html file in its root, and can view it with my browser.

(2014-10-15, 20:07:13)Hypertexter Wrote: Another way would be to add a meta tag into the index file, like
<meta name="google-site-verification" content="..." />

But: how can I manage to do that (only in the index file)?

Code:
<?php if (return_page_slug()=='index') { ?>
<meta name="google-site-verification" content="..." />
<?php } ?>
Reply
#4
Wonderful, thank you! The code worked immediately.

If your google.html works, you are happy :-)
But how come you can use the default .htaccess with fancy urls? I had to insert some rewrite rules for getting it really fancy...

@shawn_a:
I tried not to use Google Analytics because many people said it is evil (bad data protection).
Reply
#5
I still dont get it, Why would it not be able to see .html files in root?
That is what RewriteCond %{REQUEST_FILENAME} !-f
is for
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#6
I have these entries in .htaccess:

Code:
RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule /?([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]
Reply
#7
yeah should be no problem creating directories or files in root, they should all be publicly accessible.
that rule says

if not an existing directory
if not an existing file
then rewrite to index.php?id=blargh

admin
theme
data
.htaccess
index.php
somefile.html
someotherfile.php
directory/somefile.php

these should all be accesible at http://example.com/webroot/somefile.html

unless you have something else blocking it
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#8
ahhhhhh
are you using apache 2.2?

read this
http://stackoverflow.com/questions/69790...ot-working
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#9
Yes, it is
Apache Version Apache/2.2.0 (Fedora)
Apache API Version 20051115
and PHP Version 5.3.29

But what you gave me to read has not really an effect if I read it, sorry Big Grin

Seems I have to add something to my .htaccess?
Reply
#10
replace
Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

with
Code:
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d

and see if you have any luck
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#11
No! I had no luck at all:

"500 Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request."
Reply
#12
That should be compatible with 2.2 unless you have a syntax error somehow.
Ill have to spin up a 2.2 dev and see.

I think this is only a problem on some configs, like certain virtual host setups.

you might also able to make a custom rule for now like
RewriteRule ^/googlexxxxxxx\.html$ - [L]
or
RewriteCond %{REQUEST_URI} !^/googlexxxxxxx\.html$
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#13
I tried
RewriteRule ^/googlexxxxxxx\.html$ - [L]
with the "googlexxxxxxx" including .html and not, and no one worked.
Reply




Users browsing this thread: 1 Guest(s)