Posts: 260
Threads: 39
Joined: Jun 2014
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!
Posts: 6,266
Threads: 181
Joined: Sep 2011
I believe the google analytics plugin does this, the newer one.
Posts: 3,491
Threads: 106
Joined: Mar 2010
(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 } ?>
Posts: 260
Threads: 39
Joined: Jun 2014
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).
Posts: 6,266
Threads: 181
Joined: Sep 2011
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
Posts: 260
Threads: 39
Joined: Jun 2014
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]
Posts: 6,266
Threads: 181
Joined: Sep 2011
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
Posts: 6,266
Threads: 181
Joined: Sep 2011
Posts: 260
Threads: 39
Joined: Jun 2014
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
Seems I have to add something to my .htaccess?
Posts: 6,266
Threads: 181
Joined: Sep 2011
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
Posts: 260
Threads: 39
Joined: Jun 2014
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."
Posts: 6,266
Threads: 181
Joined: Sep 2011
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$
Posts: 260
Threads: 39
Joined: Jun 2014
I tried
RewriteRule ^/googlexxxxxxx\.html$ - [L]
with the "googlexxxxxxx" including .html and not, and no one worked.