Forum Moderators: phranque

Message Too Old, No Replies

Need Help With htaccess Rewrite....

htaccess help

         

promoworks

5:19 am on May 27, 2005 (gmt 0)



Hello,

I'm hoping someone can help me with this..

I have a site I'm using an htaccess on with rewriterules.

BUT, I need all requests going to a directory to NOT
be effected by the rewrite.

Here's the htaccess I'm using:

---------- [Current HTACCESS] ------------
Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteRule ^index.html$ index.php
RewriteRule ^browse-(.*)-(.*)-(.*)-(.*).html?$ index.php?Mode=$1&Browse=$2&Sort=$3&Page=$4 [QSA,L]
RewriteRule ^item-(.*).html?$ product.php?ASIN=$1 [QSA,L]
RewriteRule ^search-(.*)-(.*)-(.*)-(.*).html?$ search.php?Mode=$1&q=$2&t=$3&Page=$4 [QSA,L]
RewriteRule ^(.*)-(.*)-(.*)-(.*)-(.*).html?$ index.php?Mode=$2&Browse=$3&Sort=$4&Page=$5 [QSA,L]
RewriteRule ^(.*)-cat-(.*).html?$ index.php?cat=$2 [QSA,L]
RewriteRule ^(.*)-(.*).html?$ product.php?ASIN=$2 [QSA,L]
--------------- [ END ] ------------

Now, I need all requesting going to the /hosting/ directory to NOT be effected by thw above rewrite.

Any help would be GREAT...

Thank you -

- Ray

jdMorgan

10:07 pm on May 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ray,

Welcome to WebmasterWorld!

Add a rule at the top to exit immediately and bypass any following rules:


RewriteRule ^hosting/ - [L]

Your rules look like they will run extremely slowly. You can speed them up by using less-ambiguous patterns, such as

RewriteRule ^([^-]+)-([^-]+)-([^-]+)-([^-]+)-(.*)\.html?$ /index.php?Mode=$2&Browse=$3&Sort=$4&Page=$5 [QSA,L]

Jim