Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7851811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:16:13+00:00 2026-06-02T19:16:13+00:00

this is my robots.txt . I want to only allow the base url domain.com

  • 0

this is my robots.txt. I want to only allow the base url domain.com for indexing and disallow all sub urls like domain.com/foo and domain.com/bar.html.

User-agent: *
Disallow: /*/

Because I am not sure whether this is a valid syntax I tested it using Google Webmaster Tools. It shows me this message.

robots.txt file is probably invalid.

Is my file valid? Is there a better way of only allowing the base url for indexing?

Update: Google downloaded my robots.txt 4 hours ago. I think thats why it doesn’t work. I will wait some time and if the problem stays I will update my question again.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T19:16:15+00:00Added an answer on June 2, 2026 at 7:16 pm

    Here is a link to a validator. It might help you work through any errors in the file.

    Robots.txt Checker

    I checked on another validator, robots.txt Checker, and this is what I got for the second line:

    Wildcard characters (like “*”) are not allowed here The line below
    must be an allow, disallow, comment or a blank line statement

    This might be what you’re looking for:

    User-Agent: *
    Allow: /index.html
    Disallow: /
    

    This assumes your homepage is index.html.

    If index.php is your homepage, you should be able to swap out index.html for index.php.

    User-Agent: *
    Allow: /index.php
    Disallow: /
    

    On my dynamic websites that run through index.php, going to mydomain.com/index.php still takes me to the homepage, so the above should work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Will this robots.txt file only allow googlebot to index my site's index.php file? CAVEAT,
In my robots.txt i have this: Disallow: /lo lo is a directory with a
my robots.txt looks like this: User-agent: * Disallow: /admin Disallow: /test User-Agent: Googlebot Disallow:
I'm doing this SELECT LOAD_FILE(/home/user/domains/example.com/public_html/robots.txt) AS tmp FROM tmpTable but it returns NULL. How
User-agent: * Disallow: Disallow: /admin Disallow: /admin Sitemap: http://www.myadress.com/ext/sm/Sitemap_114.xml I've found this robots.txt file
I would like to deny web robots to access a url like this: http://www.example.com/export
I have a few doubts about this robots file. User-agent: * Disallow: /administrator/ Disallow:
I have a site with multiple subdomains and I want the named subdomains robots.txt
I want to prevent the robots from accessing URLs that end with /new .
For some reason, I want to serve my robots.txt via a PHP script. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.