Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Other Web Development Languages (http://www.programmingforums.org/forum40.html)
-   -   .htaccess help (http://www.programmingforums.org/showthread.php?t=11185)

titaniumdecoy Aug 26th, 2006 7:02 PM

.htaccess help
 
I have a .htaccess rule that will redirect any requests, starting at the directory containing the .htaccess file, to index.php:
:

RewriteRule ^$ index.php [L]
However, this will redirect anything, so /potato or /pot/head/eater will both be redirected. I need a way to redirect everything that does not begin with cookbook/. Can anyone help me out here? Thanks.

titaniumdecoy Aug 26th, 2006 7:43 PM

The closest thing I've come up with is

:

RewriteCond %{REQUEST_FILENAME} !^cookbook.*
RewriteRule ^$ index.php [L]

But it doesn't seem to work. Any ideas?

Arevos Aug 27th, 2006 5:51 AM

What about:
:

RewriteRule !(^cookbook.*) %{REQUEST_URI} [L]
RewriteRule ^$ index.php [L]


wheedwacker Sep 30th, 2006 10:58 PM

Try
:

RewriteEngine on
Before the rule. You need to turn on redirecting before you tell it how to redirect.


All times are GMT -5. The time now is 12:55 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC