Reading the .htaccess without having backend access. Possible?

7 replies
Hi everyone,

I wonder if there's a way to check the htaccess file of a given website, without being the webmaster of it.

This site I am working on (SEO wise) does't rank at all, and the owner's had it for years. I was thinking that there might be some default settings which comes with the theme, where he might have chosen "block out Google", and he get's a htaccess something like this:
Code:
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} AltaVista [OR]
RewriteCond %{HTTP_USER_AGENT} Googlebot [OR]
RewriteCond %{HTTP_USER_AGENT} msnbot [OR]
RewriteCond %{HTTP_USER_AGENT} Slurp
RewriteRule ^.*$ "http://example.com" [R=301,L]
I am not sure how likely this is. Or even if every domain comes with it's own htaccess, or if it's every hosting account which comes with it's own htaccess (?). As it's normal to host several domains on the same account.

Does anyone know if it's possible to check the htaccess of a site without owning it? I mean, when it should be possible to simulate a bot going in or something. Or reading it elsewise.
#access #backend #htaccess #reading
  • Profile picture of the author unnatural
    It's not possible to actually read the .htaccess file unless you have access to the FTP or shell or a file manager.

    That said, you can fake the googlebot (or other bots) user agents with a script and see if it's blocked or redirected.

    Keep in mind that when you are simulating you will not be able to "read" the .htaccess file. The .htaccess file is processed on the server side before any results are sent back, you will only be able to test different scenarios and outcomes.

    Not all sites will have a .htaccess by default. It's not necessary as it's just for additional rules on top of the default rules being served.

    And just for my two cents, it's not very likely
    {{ DiscussionBoard.errors[4792546].message }}
  • Profile picture of the author silvercap
    Thanks for the reply unnatural. Know if each shared hosting account comes with /one/ htaccess? Or if one could have several htaccess'es on the same shared hosting account if one has several domains on it?

    Where would the htaccess be located? Starting from the root directory in the hosting account.
    {{ DiscussionBoard.errors[4794515].message }}
    • Profile picture of the author Content Publisher
      Originally Posted by silvercap View Post

      Thanks for the reply unnatural. Know if each shared hosting account comes with /one/ htaccess? Or if one could have several htaccess'es on the same shared hosting account if one has several domains on it?

      Where would the htaccess be located? Starting from the root directory in the hosting account.
      You can have one .htaccess file PER FOLDER - so if you have 100 folders, you can have 100 htaccess files.

      Or if you have 10 addon domains (since each addon domain is a new folder), that'd be 10 extra htaccess files.
      Signature
      Follow me as I build my content publishing business from $0 to a full time income.

      "The harder the conflict, the more glorious the triumph. What we obtain too cheaply, we esteem too lightly; it is dearness only that gives everything its value." - Thomas Paine
      {{ DiscussionBoard.errors[4795020].message }}
  • Profile picture of the author SteveJohnson
    The .htaccess file is meant to be read only by the server, and modified only by those with access to the server. A user-agent (browser, bot, spider, etc.) has no access, and can't even read the file.

    I assume you're asking how to imitate the signature of the Googlebot to see what happens as it spiders the site? There is an extension for Firefox called the User-Agent Switcher, or something along those lines. You can change the user agent string that Firefox sends when making a page request, mimicking basically whatever you want.

    If you want to know what's in the .htaccess file, you'll need server access - which you should have if you're working on the site...
    Signature

    The 2nd Amendment, 1789 - The Original Homeland Security.

    Gun control means never having to say, "I missed you."

    {{ DiscussionBoard.errors[4795171].message }}
  • Profile picture of the author LakiPolitis
    If you go into webmaster tools and fetch it as google bot, you'll see if his server's blocking access right away.
    {{ DiscussionBoard.errors[4800962].message }}
  • Profile picture of the author wayfarer
    On Linux, any file that begins with a period (.) is a hidden file. Hidden files will not be served to the public by Apache, so if you want to read them, you need access to the server they are on.
    Signature
    I build web things, server things. I help build the startup Veenome. | Remote Programming Jobs
    {{ DiscussionBoard.errors[4801024].message }}
  • Profile picture of the author cannons
    dude how can you even think of reading it without the backend access. It is not posible and will never be
    {{ DiscussionBoard.errors[4870824].message }}

Trending Topics