.htaccess tutorial

htaccess Elite


Multiple Redirect Pages

Ask your mod_rewrite and Redirection questions here, and get answers!

Multiple Redirect Pages

New postby AliasBDI » 05 Mar 2010 07:27

Greetings. This issue has been my worst problem yet. I am running into a problem with clarifying which requests go to which default files. Here is what I have. I am running a custom application in the root as well as Wordpress. They are both in the root. As you may know Wordpress requires basic rewrite code like this:
Code: Select all
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]


My problem is that my custom application also needs this rewrite, but should hit /app.php instead of /index.php. So, in real life, it should work like this ... If a user requests "domain.com/books/add" the htaccess will push the request to the file "/app.php" but if they request any other page, it will push the request to the file "/index.php". Here is the thing, the rule should find all requests with "/books ..." in it. If the URL has it in there, it should push the request to "/app.php".

Is this possible? When it hits the "/app.php" file it should treat the URL and querystings just the same way.
AliasBDI
 
Posts: 1
Joined: 05 Mar 2010 07:19

Return to Redirect or Rewrite Questions