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.

Dissalow folder with the same name as allowed folder

Discussion in 'robots.txt' started by SebastienD, Jan 15, 2014.

  1. #1
    Hi guys,

    I have been searching for a solution for my problem, I'm sure it's out there but I can't seem to find the correct wording to find it online, thus my appeal to you.

    I recently created a wordpress blog for my companies website, which i put for testing on home/newsletter

    Having not linked it to any other page I wrongly assumed it would not be indexed by google, and proceeded to upload all old posts to it.

    However when I moved the finalized version of the folder to: home/resources/newsletter I started getting TONS of 404's from google webmaster.

    I wanted to put a no index in robots by putting disallow: /newsletter
    however given the second directory is ALSO named newsletter, this would prevent bots from indexing it...

    So my question is:... how do I
    disallow home/newsletter
    but allow home/resources/newsletter

    Thanks a lot guys!!!
     
    SebastienD, Jan 15, 2014 IP
  2. Joey.9999

    Joey.9999 Greenhorn

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    11
    #2
    Hi sebastien,

    To answer your second question in robots.txt, just add

    User-agent: *
    Disallow: home/newsletter

    The only problem is that google already indexed that page, and might still be on the internet. The best thing to do would be if you have google webmaster account, is to that code within robots.txt and remove the from google webmaster tool. Someone from google will remove it. Or you just perform 301 redirect if you have an apache server running and it's a link put this in your .htaccess

    redirect 301 /home/newsletter url.com/home/resources/newsletter.

    I think this is the most likable solution
    Joey
     
    Joey.9999, Feb 1, 2014 IP
  3. Nette

    Nette Active Member

    Messages:
    58
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    65
    #3
    In the robots.txt, add:
    User-agent: *
    Disallow: home/newsletter
    Allow: home/resources/newsletter
    Code (markup):
     
    Nette, Feb 2, 2014 IP
    seotraining likes this.