Forum Moderators: phranque

Message Too Old, No Replies

.htaccess causing server to give an timeout error!

modrewrite problem, firefox only

         

Ruben de Vries

11:40 am on Feb 6, 2007 (gmt 0)

10+ Year Member



Options +FollowSymlinks
RewriteEngine on

RewriteRule ^pagina-(.*?)-(.*?)-(.*?)-.*?$ pagina.php?id=$1&pag=$2&full=$3
RewriteRule ^pagina-(.*?)-(.*?)-.*?$ pagina.php?id=$1&pag=$2
RewriteRule ^pagina-(.*?)-.*?$ pagina.php?id=$1


above you see the content of my htaccess file, somehow in IE it works fine but when i try it in Firefox the complete webserver is unavailble to me (in both IE/FF/ftp/SSH) for about 5 minutes!
on other machines the server remains fine though.

please help me :)

jdMorgan

1:19 pm on Feb 6, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There are likely to be several problems here. First, .htaccess has no effect whatsoever on FTP or SSH connections; It is .htaccess, with the "ht" referring to HTTP connections only.

Your code is inefficient, so the following changes might speed it up a little, but this does not answer the FTP/SSH or FF vs. IE differences:


Options +FollowSymlinks
RewriteEngine on
#
RewriteRule ^pagina-([^-]+)-([^-]+)-([^-]+)-.*$ pagina.php?id=$1&pag=$2&full=$3 [L]
RewriteRule ^pagina-([^-]+)-([^-]+)-.*$ pagina.php?id=$1&pag=$2 [L]
RewriteRule ^pagina-([^-]+)-.*$ pagina.php?id=$1 [L]

This code replaces the ambiguous and greedy ".*" patterns with patterns that are specific, matching any character except for the hyphen used to delimit your parameters. This allows the requested URL-path to be evaluated in a single left-to-right pass, instead of requiring many recursive matching attempts. The [L] flag is used to terminate mod_rewrite processing when a rule pattern matches and the URL is rewritten.

In all cases, flush your Firefox cache and clear your IE Temporary Internet Files before testing any changes to your .htaccess file.

If your SSH/FTP delays continue after flushing your cache, I suggest you contact your host for assistance, as it will likely require server-level logs and tools to diagnose the problem.

Jim