homepage Welcome to WebmasterWorld Guest from 54.242.18.190
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
.htaccess and commercial servers
Looking for my "root"
epanastatis




msg:1515409
 3:00 pm on Sep 27, 2003 (gmt 0)

My domain is hosted by a commercial service (Earthlink). They have it set up so that all of my pages are in a folder called "webdocs". My question is, if I want to code an .htaccess file to control access to my site, is it sufficient for me to just upload it to this "webdocs" folder, or do I need go up a level? And if I do this without consulting with Earthlink customer service (who, to my taste, are too slow) first, is there any chance that this would interfere with the overall functioning of the site.

 

marcs




msg:1515410
 3:21 pm on Sep 27, 2003 (gmt 0)

Upload it to the same directory that holds your home page. This .htaccess file when then affect your entire site.

A .htaccess file can indeed cause a web site to not function as expected. In that case, remove the invalid .htaccess file, correct it and upload it again.

epanastatis




msg:1515411
 12:25 am on Sep 28, 2003 (gmt 0)

marcs,

Thanks for the advice. I'm having a problem, however. When I uploaded .htaccess I immediately started getting 500 errors when trying access my site.

What I had intended to was redirect 404s to a custom page, and to ban the Internetseer bot from the page. Without access to the Apache error logs, I can't tell what I did wrong or if there's something higher up on the server interfering with this.

Here's what I wrote:

ErrorDocument 404 /404.html

RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^InternetSeer.com [OR]
RewriteCond %{HTTP_USER_AGENT} ^sitecheck.internetseer.com
RewriteRule ^.* - [F]

Any ideas?

jdMorgan




msg:1515412
 12:55 am on Sep 29, 2003 (gmt 0)

epanastatis,

The code looks OK.

I can think of two possibilities:
1) You need to add "Options +FollowSymLinks" on a new line before "RewriteEngine on" -or-
2) You are not allowed to use mod_rewrite on Earthlink.

You might be able to use mod_access to ban internetseer - it might work even if mod_rewrite is not allowed.

SetEnvIf User-Agent [Ii]nternet[Ss]eer\.com getout
<Files *>
Deny from getout
</Files>

Jim

epanastatis




msg:1515413
 10:33 pm on Sep 29, 2003 (gmt 0)

Thanks, jdMorgan! I tried your first suggestion and still got the 500 error, so I'm leaning toward the thesis that Earthlink doesn't allow mod_rewrite (though as expected they haven't answered my question about that...) I'm testing your second suggestion, and it hasn't had any negative repercussions, but it'll take me a couple days to see if it's successfully repulsing Internetseer.

As usual, WebmasterWorld has proven to be very valuable.

closed




msg:1515414
 2:09 am on Sep 30, 2003 (gmt 0)

it'll take me a couple days to see if it's successfully repulsing Internetseer

Or you could just use Wannabrowser and see right now. :)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved