LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 01-17-2006, 07:40 PM   #1
Boby
Member
 
Registered: Feb 2004
Location: Sighisoara/Cluj-Napoca (Romania)
Distribution: CentOS 4, Fedora Core 6
Posts: 781

Rep: Reputation: 31
Exception in mod-rewrite rule


Hello!

I have to change a mod-rewrite rule from a server where Mambo CMS is installed. The default htaccess is this one:
Code:
      ##
Redirect Permanent /home http://www.domain.com
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.com
RewriteRule ^(.*)$ http://www.domain.com/$1 [r=301,L]

#  Uncomment following line if your webserver's URL
#  is not directly related to physical file paths.
#  Update YourMamboDirectory (just / for root)
# RewriteBase /YourMamboDirectory
#
#  Rules
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php
I set up a new directory called "test", in it is another htaccess file that rewrites the URL for a page with US states. The htaccess file in "test" is this:
Code:
      RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(AK|AL|AR|AS|AZ|CA|CO|CT|DC|DE|FL|FM|GA|GU|HI|IA|ID|IL|IN|KS|KY|LA|MA|MD|ME|MH|MI|MN|MO|MP|MS|MT|NC|ND|NE|NH|NJ|NM|NV|NY|OH|OK|OR|PA|PR|PW|RI|SC|SD|TN|TX|UT|VA|VI|VT|WA|WI|WV|WY)/([^/]*)/?([^/]*)/?([0-9]*)/?([^/]*)/?([^/]*)/?$ index.php?state=$1&cityprefix=$2&city=$3&zip=$4&category=$5&subcategory=$6 [L]
But when I go now to http://www.domain.com/test/ or http://www.domain.com/test/index.php or whatever it does not allow me to run the file because it somehow handels the directory as one of the root Mambo files.

My question is now, how to I change the first htaccess file so it rewrites the URL only if it is NOT "test", or to let me run "test" directory and ignoring the other rules.

Thank you!

Kind regards, Boby.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting 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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
compile apache source rpm with mod rewrite robertngo Linux - Software 3 07-21-2005 03:44 AM
Mod Rewrite Help carminejg3 Linux - Software 0 12-20-2004 05:19 PM
Exim4 rewrite rule for multiple email addresses Hcman Linux - General 3 10-09-2004 02:46 PM
Help me make this rewrite rule in Apache ganninu Linux - General 8 01-07-2004 08:30 AM
apache mod rewrite Robert0380 Linux - Software 5 07-31-2003 04:42 PM


All times are GMT -5. The time now is 04:17 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration