Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > .htaccess slows my server

.htaccess slows my server
Thread Tools
Mac Enthusiast
Join Date: Jul 2003
Status: Offline
Reply With Quote
Sep 5, 2005, 10:31 AM
 
I am using a set of security scripts that I bought to protect my website. There are several methods of protection- one of which uses .htaccess, utilizing mod_rewrite.

When I employ this method, it seems that the performance of the server really takes a hit.

For example, I use a pop-up javascript driven menu that works great when the file is not in a directory that uses mod_rewrite protectio, but if the file sits in a directory that is protected using mod_rewrite, it essentially cripples the performance of the menu when using internet explorer for windows.

Interestingly, the menu seems to work OK in Safari regardless, but in Win IE, it breaks down when it sits in a protected directory.

I did some reading, and found that there are some commands that can influence server speed such as the RewriteLogLevel. So, I started thinking that maybe the crippled performance is due to a slowdown of the server- perhaps related to what's going on inside the .htacces file.

Here's what is in my .htaccess file:

Options +FollowSymLinks
RewriteEngine On
RewriteCond $1 !special_login\.php
RewriteRule ^(.+)$ special_login.php?thefile=$1

Don't know much about this stuff- mostly stabbing in the dark. Based on the above discussion, what is the likelihood that my theory is correct (that the menu is performing poorly because of server slowdown), and what are the chances that it can be corrected by modifying the .htaccess file?

Here is an example of a non-protected page that works well in all browsers.

And, this one gets crippled in Windows IE. When trying to access this, use the login name GUEST1 and password PASSWORD.

Thanks for you thoughts.
     
Addicted to MacNN
Join Date: Jan 2000
Location: Stoneham, MA, USA
Status: Offline
Reply With Quote
Oct 2, 2005, 01:43 PM
 
.htaccess files in general slow down performance, and putting mod_rewrite rules within them slows things down even more. Your best bet is, if you have access, to put all the rules and everything else in your .htaccess file, in your apache httpd.conf file.
     
Mac Enthusiast
Join Date: Jan 1999
Location: Marietta, GA, USA
Status: Offline
Reply With Quote
Oct 11, 2005, 07:31 AM
 
If you get good performance from Safari, but not from IE, then it's not a server issue. Either the perceived difference is not real, or there is something on the page that is slowing down IE (the JavaScript maybe?).
Scott Genevish
scott AT genevish DOT org
     
Mac Enthusiast
Join Date: Jul 2003
Status: Offline
Reply With Quote
Oct 11, 2005, 08:27 AM
 
solid insight. probably the java.
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Oct 11, 2005, 12:57 PM
 
.htaccess and mod_rewrite do slow down Apache somewhat, but that performance hit happens on the server side, so it should affect all browsers equally. As genevish noted, when one browser is slower than others, it's usually something to do with either JavaScript or a plug-in you're using.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:28 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2