URL rewrite - make exception

My url-rewrites works perfectly after receiving some help here. However, I can't access my admin2-folder. I got the following code in my .htaccess file: Options +FollowSymLinks -MultiViews RewriteEngine On RewriteBase /test-site/

RewriteCond %{REQUEST_URI} !^/admin2/?$ [NC]

RewriteRule ^([^/]+)/([a-z]+)/(\d+)/?$ index.php?site=$1&cmd=$2&id=$3 [L,NC,QSA]
RewriteRule ^([^/]+)/([a-z]+)/?$ index.php?site=$1&cmd=$2 [L,NC,QSA]
RewriteRule ^([^/]+)/(\d+)/?$ index.php?site=$1&id=$2 [L,QSA]
RewriteRule ^([^/]+)/?$ index.php?site=$1 [L,QSA]

When trying to access localhost/test-site/admin2, it just redirects me to localhost/test-site/admin2/?site=admin2. How can I solve this?

Thanks in advance.

Answers


This solved my problem:

RewriteRule ^admin2($|/) - [L]

RewriteRule ^([^/]+)/([a-z]+)/(\d+)/?$ index.php?site=$1&cmd=$2&id=$3 [L,NC,QSA]
RewriteRule ^([^/]+)/([a-z]+)/?$ index.php?site=$1&cmd=$2 [L,NC,QSA]
RewriteRule ^([^/]+)/(\d+)/?$ index.php?site=$1&id=$2 [L,QSA]
RewriteRule ^([^/]+)/?$ index.php?site=$1 [L,QSA]

Need Your Help

ReportViewer displaying black background in Print Layout mode

visual-studio reporting-services reportviewer

In my ReportViewer control, when I click on Print Layout, the background turns black on the report. This must be a bug. Is there a workaround?

Fusebox 5 issues when replacing files

coldfusion railo fusebox

Today, no matter what I did, my application just would not recognise a change I did to a file I uploaded. I even put a cfabort at the top of the page and it just ignored it.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.