Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 26th, 2006, 6:02 PM   #1
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 856
Rep Power: 3 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
.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 is offline   Reply With Quote
Old Aug 26th, 2006, 6:43 PM   #2
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 856
Rep Power: 3 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
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?
titaniumdecoy is offline   Reply With Quote
Old Aug 27th, 2006, 4:51 AM   #3
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
What about:
RewriteRule !(^cookbook.*) %{REQUEST_URI} [L]
RewriteRule ^$ index.php [L]
Arevos is offline   Reply With Quote
Old Sep 30th, 2006, 9:58 PM   #4
wheedwacker
Newbie
 
Join Date: Sep 2006
Posts: 2
Rep Power: 0 wheedwacker is on a distinguished road
Try
RewriteEngine on
Before the rule. You need to turn on redirecting before you tell it how to redirect.
wheedwacker is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
.htaccess error pages Intimidat0r Other Web Development Languages 6 Jul 31st, 2005 7:43 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:36 AM.

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