views:

8

answers:

0

Well I only have 2 things going on here

RewriteEngine on
#part 1. if testdir/something is typed in
#        then go to testdir?id=something
RewriteCond %{REQUEST_URI} home/testdir
RewriteRule home/testdir/(.*)$ /home/testdir?page=$1 [L]

#part 2. Send everything else to the homepage unless
#        it is a file that exists, or if the request doesnt end with .php
RewriteCond %{REQUEST_URI} !(.*\.php$) [NC]
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteRule .* /index.php [NC]

The 2nd part works. My problem is that part 1 never executes. The request is always handled by the big catcher.

If I go to this page:

/home/testdir/example

and it tells me page doesnt not exist. this is because the url is not rewritten. It is actually looking for the example page in the testdir folder, but that does not exist. It should be rewritten to access the testdir file and it can handle the example parameter. So how can I make the rewrite condition catch a request?

The condition im trying for is to take any request that contains this text:

home/testdir