Rewrite rule for only index

Hi, could use some help here. Currently I have the following rules which redirects all request ( to index.php?pathInfo=test

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php?pathInfo=$1 [PT,L]

Is there a way whereby if I request something like:

htaccess will ignore and let it passthru as a normal script request? Any help is greatly appreciated.


I believe that your use of the PassThrough flag is incorrect - I would have simply used [L].

Yes, include a test (RewriteCond) which specifies NOT id=blah then use your RewriteRule.

WARNING: [rant #1][indent]The use of “lazy regex,” specifically the :kaioken: EVERYTHING :kaioken: atom, (.*), and its close relatives, is the NUMBER ONE coding error of newbies BECAUSE it is “greedy.” Unless you provide an “exit” from your redirection, you will ALWAYS end up in a loop![/indent][/rant #1]

Moreover, it is the easiest way for hackers to gain access to your server. NEVER redirect an unverified $_GET variable like this!

You might benefit from reading the mod_rewrite tutorial linked in my signature as it contains explanations and sample code. It’s helped may members and should help you, too.