views:

46

answers:

2

I'm trying to set up a site that forwards everything but the root directory and index into a variable. I have the htaccess file set up like this right now:

Options +FollowSymlinks
RewriteEngine on

RewriteRule -(.*)$ http://blah.com/blah.php?name=$1 [R,NC]

just so that the index works and anything that starts with a hyphen(-) is rewritten

I would like to be able to have anything that isn't the index file rewritten, and still allow the index file be accessed via blah.com and blah.com/

Any ideas?

A: 

Try this :

RewriteCond %{REQUEST_URI}   !^/index.php$
RewriteCond %{REQUEST_URI}   !^/blah.php
RewriteCond %{REQUEST_URI}   !^$
RewriteRule ^(.*)         http://blah.com/blah.php?name=$1 [R,NC]
radius
this is giving me a redirect loop
Matt
Right of course ! I edited to correct
radius
it's still looping
Matt
A: 

If by any chance you still haven't figured this out, this should work:

RewriteCond %{REQUEST_URI} !^(/|/index.php|/blah.php)$
RewriteRule ^(.*)$ blah.php?name=$1 [R]
qmega