1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

I can't verify my Google account because of my .htaccess!

Discussion in 'Apache' started by newmanx, Jul 16, 2008.

  1. #1
    Hi there,

    My .htaccess file redirects (rewrites) all .html to .php
    I need to add Google's file in order to verify my account (Webmaster Tools) but it can't find the file because of my .htaccess.

    
    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{http_host} ^mydomain.com [nc]
    rewriterule ^(.*)$ http://www.mydomain.com/$1 [r=301,nc] 
    
    rewritecond %{http_host} ^/index.html [nc]
    rewriterule ^(.*)$ http://www.mydomain.com/$1 [r=301,nc]
    
    RewriteRule ^(.*)\.html$ $1.php [NC]
    
    Code (markup):
    How can I solve this?
     
    newmanx, Jul 16, 2008 IP
  2. twhiting9275

    twhiting9275 Active Member

    Messages:
    305
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    80
    #2
    They offer two options:
    #1: create a google file.
    This sometimes works, but it will most likely cause problems in your case

    #2: add header code to all pages.
    This will most likely work for you

    If neither work for you, make sure that your htaccess is setup properly, because if the second doesn't work , then most likely no search engine will be able to access your website.
     
    twhiting9275, Jul 17, 2008 IP
  3. t2000q

    t2000q Prominent Member

    Messages:
    4,636
    Likes Received:
    192
    Best Answers:
    0
    Trophy Points:
    300
    Digital Goods:
    1
    #3
    maybe disable your .htaccess until it gets verified, then put it back after it is verified
     
    t2000q, Jul 17, 2008 IP
  4. twhiting9275

    twhiting9275 Active Member

    Messages:
    305
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    80
    #4
    Won't work
    Google periodically retries to verify the site, so as soon as you put it back, you lose the 'validation' status.

    The best choice in something like this is a header tag
     
    twhiting9275, Jul 17, 2008 IP
  5. ahmadfarhan

    ahmadfarhan Peon

    Messages:
    211
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #5
    use the meta tag method.
    the html method seems a little iffy..
    if works sometimes but not other times...
     
    ahmadfarhan, Jul 17, 2008 IP
  6. Camay123

    Camay123 Well-Known Member

    Messages:
    3,423
    Likes Received:
    86
    Best Answers:
    0
    Trophy Points:
    160
    #6
    Add an exception to your rewrite rule.

    Try this:

    RewriteCond %{REQUEST_URI} !/forum

    Where forum is the place the enter the verify filename
     
    Camay123, Jul 18, 2008 IP
  7. itfiji00

    itfiji00 Banned

    Messages:
    63
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Thanks for the info..
    I will try that...
    Also i have put a sitemap in public_html/sitemap/sitemap.xml
    Will google be able to access that..How can i allow google to go in my website through .htaccess
    Please help
     
    itfiji00, Aug 14, 2008 IP
  8. itfiji00

    itfiji00 Banned

    Messages:
    63
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Oh will a Sitemap and verifying my webiste help in ranking??
    Thanks
     
    itfiji00, Aug 14, 2008 IP
  9. rakeshp37

    rakeshp37 Greenhorn

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #9
    Simply insert below code.
    RewriteEngine On
    RewriteRule ^google149e37e6d0ddce9a.html$ - [L]
    RewriteRule ^([^/]*)\.html$ /index.php?page=$1 [L]


    Note:- Change file name "google149e37e6d0ddce9a" to yours...

    Thanks,
    Rakesh Patel
    http://divinewebtechnology.com/
    Skype:- rakesh_patel33
     
    rakeshp37, May 15, 2014 IP