1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Other .HTACCESS Issue

Discussion in 'Custom Service/Development Requests' started by tommydamic68, Jan 10, 2014.

  1. tommydamic68

    tommydamic68 Well-Known Member

    Willing to pay someone can figure out why my .htaccess file or something else is causing my robots.txt to NOT show to search engines. When typing in my site URL, it redirects to just the sites URL. if I type www.mysite.com/robots.txt it just redirects to www.mysite.com

    Please PM me - Thank you.
     
  2. Nobita.Kun

    Nobita.Kun Well-Known Member

    Why you don't post content of .htacess there? So many people can help ;)
     
  3. tommydamic68

    tommydamic68 Well-Known Member

  4. MattW

    MattW Well-Known Member

    Possibly this one:
    Code:
    RewriteRule ^.*$ /community/ [R=301,L]
     
  5. tommydamic68

    tommydamic68 Well-Known Member

    No - it didn't work. Thanks for trying @MattW
     
  6. MattW

    MattW Well-Known Member

  7. tommydamic68

    tommydamic68 Well-Known Member

    So what does this mean @MattW
     
  8. MattW

    MattW Well-Known Member

    Well that rule you have in place, will look for ANYTHING in the / directory, regardless of filename or extension type, and will redirect it to your community directory.
     
  9. tommydamic68

    tommydamic68 Well-Known Member

    Can I change intro work properly?
     
  10. Bryan Gilchrist

    Bryan Gilchrist Active Member

    It means no matter what you type in, it will forward to your /community directory.

    Just move your robots.txt to your /community directory.
     
  11. tommydamic68

    tommydamic68 Well-Known Member

    Will try when I get home - will it serve the same purpose with robots in that folder as apposed to the root? I think that redirect was given to me by @Jake Bunce - can't I just change, remove or correct it to work properly?
     
  12. Bryan Gilchrist

    Bryan Gilchrist Active Member

    It should because pretty much anyone that goes to your site, including search engines, is seeing your /community directory as your root directory.
     
  13. tommydamic68

    tommydamic68 Well-Known Member

    Ok- will update later.
     
  14. tommydamic68

    tommydamic68 Well-Known Member

    Nope - no good, still redirects to URL - no robots.txt...:(
     
  15. tommydamic68

    tommydamic68 Well-Known Member

    And if i remove that code, I do get the robots.txt - however my site doesn't work correct. I REALLY wish @Jake bunco would chime in - he gave me the rewrite code…probably a simple fix.
     
  16. nodle

    nodle Well-Known Member

  17. Bryan Gilchrist

    Bryan Gilchrist Active Member

    If you're trying to go to yoursite.com/robots.txt with the redirect, it won't work no matter what.

    If you have your robots.txt file in your /community directory, it will be fine. The search engines will still see it.

    Search engines don't know where your home directory is, so they are going to look for the first instance of robots.txt which, with the redirect, will be in your /community directory.

    If you're still wanting to put the robots.txt into your root directory, then you can use a META REFRESH instead of an .htaccess redirect.

    In your root directory, edit a file called "index.html", and in that file, put the following code:

    Code:
    <meta http-equiv="refresh" content="0;URL='http://www.yoursite.com/community'" />
    That way, when you go to www.yoursite.com/robots.txt it will be there.

    Just be sure to remove the redirect in your .htaccess file if you choose to do this. Also, you'll have to add "community/" to all of your disallow links so the search engine knows not to look at the links/directories listed in your /community directory.
     
    Last edited: Jan 10, 2014
  18. EQnoble

    EQnoble Well-Known Member

    I had to laugh here...bunco is a dice game lol:) You ended up tagging the wrong user ;-)
     
  19. tommydamic68

    tommydamic68 Well-Known Member

  20. tommydamic68

    tommydamic68 Well-Known Member

    Thanks everyone for the help!
     

Share This Page