|
| |
|
|
Starhugger
Posts: 529 Joined: 4/12/2005 Status: offline
|
Index slow to load after htaccess changes - 2/19/2006 1:47:35
My front page (index.htm) is suddenly taking a LONG time to load, for no apparent reason. Earlier today I was making some changes to the htaccess file to keep people from hotlinking to me and to keep them from accessing my directories. I used the code I found in the tutorial here, as well as trying code from other sites too. Well, I couldn't get the anti-hotlinking code to work without also blocking my own site from accessing my image files, so I finally just took out the code. But I left in the code that keeps viewers from accessing my directories directly (Options -indexes). That seemed to be working fine with no side effects. But I just happened to check the front page now (which is called index.htm) and it is taking forever to load. Even when I've taken that out of the htaccess, it's still taking forever to load. The banner and navigation at the top come up, but the rest of the page is blank for a good half to whole minute, then the page loads. I don't know why it's doing this to me and I'm ready to pull my hair out by the roots. The htaccess is now back to what it was before I started messing with it this morning. I also found some weird code from Amazon which might be their new more-info demi-windows, although I never had a problem with it before. In any case, I took it out too, but it's still doing it. I even tried clearing my temp files and cookies and reloading the browser. No change. Can someone please take a look at the View Source and see if they can figure out what might be causing this? It just started doing it today. I don't know if I accessed the index page earlier today, and I was busy elsewhere today, so I don't know exactly when it started doing it - just sometime today. Thank you in advance for the help! The URL is www.evolvingdoor.ca. Starhugger
|
|
|
|
Kitka
Posts: 2520 Joined: 1/31/2002 From: Australia Status: offline
|
RE: Index slow to load after htaccess changes - 2/19/2006 2:21:23
If it is any consolation, I loaded your index page just now, and it came straight down with no unusual delays. Regarding modifying .htaccess to prevent hotlinking, you might find this wizard useful: http://www.htmlbasix.com/disablehotlinking.shtml It generates the code for you and gives four alternatives if one doesn't work on your server. Remember that if you publish using Frontpage, you'll need to edit the .htaccess files of 3 other directories as per this thread: http://www.frontpagewebmaster.com/m-266165/tm.htm#285265 Otherwise you'll be prevented from publishing.
_____________________________
Kitka **It is impossible to make anything foolproof because fools are so ingenious.**
|
|
|
|
Starhugger
Posts: 529 Joined: 4/12/2005 Status: offline
|
RE: Index slow to load after htaccess changes - 2/20/2006 14:41:41
Okay, I've implemented the anti-hotlinking code using that code generator. Thanks for the link to that, Kitka! As far as I can tell, it's working. Two sites that I know are hotlinking to me *seem* to be getting the intended substitute image. Would someone here mind trying to hotlink to me and let me know what happens? I only have the one site so I can't test it myself, and I just want to be sure. Thanks in advance! www.evolvingdoor.ca Starhugger
|
|
|
|
Kitka
Posts: 2520 Joined: 1/31/2002 From: Australia Status: offline
|
RE: Index slow to load after htaccess changes - 2/20/2006 17:36:25
I was just checking to see if your substitute image was served (which it was, Yay!) and I thought to see if your images directory allows a visitor to see the index of files - which it does. Personally, I don't think that is a good thing. I disallow directory file listings by modifying Options in .htaccess like this: Options +FollowSymLinks -Indexes I'm not sure if modifying the .htaccess in root will govern all sub-directories, or if you'll need to add an .htaccess to the images folder too. But try doing the root one first, then type this in your browser address bar and see what happens: http://www.evolvingdoor.ca/imagelinks/ If it lists your files, add an .htaccess file to the imagelinks folder.
_____________________________
Kitka **It is impossible to make anything foolproof because fools are so ingenious.**
|
|
|
|
Starhugger
Posts: 529 Joined: 4/12/2005 Status: offline
|
RE: Index slow to load after htaccess changes - 2/20/2006 18:41:24
quote:
I was just checking to see if your substitute image was served (which it was, Yay!) and I thought to see if your images directory allows a visitor to see the index of files - which it does. Personally, I don't think that is a good thing. I disallow directory file listings by modifying Options in .htaccess like this: Options +FollowSymLinks -Indexes I'm not sure if modifying the .htaccess in root will govern all sub-directories, or if you'll need to add an .htaccess to the images folder too. But try doing the root one first... I totally agree. And actually, this was one of the problems that first caused me to post this thread. After putting in that Options code, I was getting extremely slow loading of my home page, which is called index.htm. I don't have any other files by that name (some use "index" in the name, but not by itself). The only page that seemed to be affected was my home page, index.htm. Does this mean I'll have to put .htaccess files in EVERY directory to avoid party crashers? I'd rather not rename my home page because some webites link to it specifically. Ideas? Starhugger
|
|
|
|
Kitka
Posts: 2520 Joined: 1/31/2002 From: Australia Status: offline
|
RE: Index slow to load after htaccess changes - 2/27/2006 2:04:31
quote:
I'm seeing a LOT of 302 errors coming up now (temporary redirects). Is this how attempted forbidden accesses show up in my stats? It shouldn't be! Normally "Forbidden Access" error is a 403. But of course it depends totally on how you have your .htaccess set up. Would you like to post all the Mod_Rewrite section of your .htaccess file here for us to look at? Actually, post all of it, except the FrontPage stuff at the beginning.
_____________________________
Kitka **It is impossible to make anything foolproof because fools are so ingenious.**
|
|
|
|
Starhugger
Posts: 529 Joined: 4/12/2005 Status: offline
|
RE: Index slow to load after htaccess changes - 2/27/2006 2:18:08
Hi Kitka, Okay, first off, here are my error stats for this month, so you can see what I mean. (Sorry, I can't do columns in this forum, but you get the idea.) quote:
404 Document Not Found 922 36.8 % 0 302 Moved temporarily (redirect) 709 28.3 % 217.42 KB 206 Partial Content 559 22.3 % 6.45 MB 301 Moved permanently (redirect) 201 8 % 67.33 KB 403 Forbidden 61 2.4 % 0 401 Unauthorized 23 0.9 % 115 Bytes 500 Internal server Error 18 0.7 % 0 400 Bad Request 3 0.1 % 0 406 Document not acceptable to client 2 0 % 704 Bytes 405 Method not allowed 2 0 % 660 Bytes To give you an idea of context for the 709 temporary redirect hits, last month (Jan/06) I had only 27! Not sure where they came from either. Here is the .htaccess code: quote:
Options +FollowSymLinks -Indexes RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www\.)?evolvingdoor.ca(/)?.*$ [NC] RewriteRule .*\.(gif|jpg)$ http://www.evolvingdoor.ca/imagelinks/stolen.jpe [R,NC] Redirect permanent /products http://www.evolvingdoor.ca/goodies RedirectMatch permanent ^/testonly/rxintro.htm$ http://www.evolvingdoor.ca/miscarticles/rxintro.htm What follows is a bunch of redirects like the last line, to deal with various pages that have been moved or renamed. They're all permanent redirects, like the last line. Thanks for the help! Starhugger
|
|
|
|
Kitka
Posts: 2520 Joined: 1/31/2002 From: Australia Status: offline
|
RE: Index slow to load after htaccess changes - 2/27/2006 4:32:22
quote:
RewriteRule .*\.(gif|jpg)$ http://www.evolvingdoor.ca/imagelinks/stolen.jpe [R,NC] The answer is in the above line. Your code is not serving up a 403 "Forbidden" error page, you are redirecting the request to different image (stolen). If you wish people to receive a 403, you need this line instead: RewriteRule .*\.(gif|jpg)$ [F] But then they won't see your "stolen" graphic, they will get the normal error page. You can decide what sort of a redirect it is e.g. permanent or temporary. If you want permanent place this at the end: [R=301, NC] instead of [R,NC] Temporary would be: [R=302, NC] If you haven't done so already, it is highly advisable to restrict (eliminate) people looking only for images by blocking the Image bots from indexing your images via robots.txt. These are the ones I banned, plus I also ban all robots from indexing the images directory: User-agent: Googlebot-Image
User-agent: Web.Image.Collector
User-agent: ObjectsSearch
User-agent: psbot
Disallow: /
User-agent: *
Disallow: /images/
That cuts down hugely on people trying to hotlink too. Because they have no easy way of finding exactly what they want. Sorry if this post is a bit incoherent, its been a long, tiring day and I'm not thinking straight. Please ask for clarification about anything I have muddled.
_____________________________
Kitka **It is impossible to make anything foolproof because fools are so ingenious.**
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|