navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Index slow to load after htaccess changes

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> General Web Development >> Index slow to load after htaccess changes
Page: [1]
 
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
Starhugger

 

Posts: 529
Joined: 4/12/2005
Status: offline

 
RE: Index slow to load after htaccess changes - 2/19/2006 2:15:44   
Okay, never mind. I just did a cold reboot of my whole computer and it seems to be fine now. Sigh... I hate it when it does this to me... :)

Carry on.

Starhugger

P.S. - If anyone has any ideas how I can get those htaccess changes to work, please let me know!


(in reply to 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.**


(in reply to Starhugger)
Kitka

 

Posts: 2520
Joined: 1/31/2002
From: Australia
Status: offline

 
RE: Index slow to load after htaccess changes - 2/19/2006 2:24:10   
quote:

Carry on.


LOL - I was composing my reply and didn't see this till I had submitted it.

I hope my info about .htaccess assists :)

_____________________________

Kitka
**It is impossible to make anything foolproof because fools are so ingenious.**


(in reply to Starhugger)
Starhugger

 

Posts: 529
Joined: 4/12/2005
Status: offline

 
RE: Index slow to load after htaccess changes - 2/19/2006 3:20:57   
quote:

ORIGINAL: Kitka

If it is any consolation, I loaded your index page just now, and it came straight down with no unusual delays.

Thanks Kitka! That's good to know.

quote:

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.

Thanks again. I'll check these out tomorrow. I was having problems accessing a directory listing from inside FP after I put in the anti-hotlinking code too. I didn't see anything more about it in the forum here, so thanks for pointing the way to a thread that talks about it. I'll letcha know how I make out! :)

Starhugger

(in reply to Kitka)
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

(in reply to Starhugger)
Starhugger

 

Posts: 529
Joined: 4/12/2005
Status: offline

 
RE: Index slow to load after htaccess changes - 2/20/2006 16:19:46   
Oh :)!!!

Okay, it seems to be blocking the hotlinking as far as I can tell (judging by the sites that have been hotlinking to me). But now I can't access my site through FP!! I can't upload, I can't get a directory listing, nothing. It tells me the FP features may not be installed, which is nonsense. I guess I need to include my FP somehow in the list of sites that are allowed to hotlink (which would include my own site). But I have no idea how to do that since my FP doesn't have a domain address, as such. How do I do this? Thanks.

Starhugger

(in reply to Starhugger)
Kitka

 

Posts: 2520
Joined: 1/31/2002
From: Australia
Status: offline

 
RE: Index slow to load after htaccess changes - 2/20/2006 16:52:06   
quote:

But now I can't access my site through FP!! I can't upload, I can't get a directory listing, nothing.


You forgot about the most important part of my first message:

quote:

ORIGINAL: Kitka

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.


If you modify the .htaccess of the three folders I mentioned in that thread, by adding or changing Options from "None" to this:

Options +FollowSymLinks

... you will be able to publish with FP.

:) :)

_____________________________

Kitka
**It is impossible to make anything foolproof because fools are so ingenious.**


(in reply to 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.**


(in reply to Starhugger)
Starhugger

 

Posts: 529
Joined: 4/12/2005
Status: offline

 
RE: Index slow to load after htaccess changes - 2/20/2006 18:32:50   
quote:

You forgot about the most important part of my first message...

Oops! :) I thought that was only related to blocking direct access to my directories by strangers and vagabonds.

Thanks! It works. :)

Starhugger

(in reply to Kitka)
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

(in reply to Kitka)
Starhugger

 

Posts: 529
Joined: 4/12/2005
Status: offline

 
RE: Index slow to load after htaccess changes - 2/21/2006 21:16:35   

quote:

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.

Okay, I tried this anyway, even though I had problems before, but it seems to be okay. I can't hack into the directory listings through my browser, but I can still access everything through FP. So far so good. Yay! :)

I seem to have another problem though...or at least a kind of messy side effect. Here's the error message I get when I try to access a web directory:

quote:

Forbidden
You don't have permission to access /lowdown/ on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

--------------------------------------------------------------------------------

Apache/1.3.34 Server at www.evolvingdoor.ca Port 80


What is the ErrorDocument that it's trying to use and can't find? Is there a way I can redirect directory requests to my front page or something? If so, what error code would I use to catch it? 404, or something else?

Thanks again.

Starhugger

(in reply to Kitka)
Kitka

 

Posts: 2520
Joined: 1/31/2002
From: Australia
Status: offline

 
RE: Index slow to load after htaccess changes - 2/21/2006 23:10:45   
quote:

So far so good. Yay!


Excellent! :)

quote:

What is the ErrorDocument that it's trying to use and can't find?


It is looking for a custom 403 error document, and when it didn't find one, it threw the normal 404 error "Document not found".

Setting up a custom 403 or 404 pages is easy. Control Panel (if you have one) has an icon for it, and once you have constructed one, it will add the necessary entry (that tells the browser where to find it) to .htaccess for you.

It usually looks something like this:

<Files 404.shtml>
order allow,deny
allow from all
</Files>


but sometimes looks like this:

ErrorDocument 404 /my404.htm


There is a good article here which explains in detail about creating custom 404 files:

http://www.yourhtmlsource.com/sitemanagement/custom404error.html

quote:

Is there a way I can redirect directory requests to my front page or something? If so, what error code would I use to catch it? 404, or something else?


I really don't know the answer to that. :) I imagine it would be possible but have no idea how.

_____________________________

Kitka
**It is impossible to make anything foolproof because fools are so ingenious.**


(in reply to Starhugger)
Starhugger

 

Posts: 529
Joined: 4/12/2005
Status: offline

 
RE: Index slow to load after htaccess changes - 2/27/2006 1:42:12   
Thanks for the info on the error pages, Kitka.

I have another question (for anyone) about the .htaccess blocking. I'm seeing a LOT of 302 errors coming up now (temporary redirects). Is this how attempted forbidden accesses show up in my stats?

My only concern about this is that I remember reading somewhere that Google tends to frown on a lot of temporary redirects, as I think it is a technique sometimes used by spam sites. I'm wondering if anyone here has any knowledge or experience with this? I just don't want to wind up shooting myself in the foot. :) Thanks!

Starhugger

(in reply to Kitka)
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.**


(in reply to Starhugger)
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

(in reply to Kitka)
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.**


(in reply to Starhugger)
Page:   [1]

All Forums >> Web Development >> General Web Development >> Index slow to load after htaccess changes
Page: [1]
Jump to: 1





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