Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RewriteEngine

Status
Not open for further replies.

JamesGMills

Programmer
Aug 15, 2005
157
GB
Hi All,

I have this to redirect all requests to index.php which then handles all the other stuff... but I want this to work for everything except /admin/

Can anyone help please...

RewriteEngine on
RewriteRule !\.(gif|jpg|png|css)$ index.php

------------------------
 
this is actually a question for the Apache forum, but here's a few lines from one of my .htaccess files to get you started:
Code:
RewriteEngine On

RewriteRule ^referral$ [URL unfurl="true"]http://www.bniconnection.com/?content=tour/tell_someone[/URL] [R]
RewriteRule ^referrals$ [URL unfurl="true"]http://www.bniconnection.com/?content=tour/tell_someone[/URL] [R]
RewriteRule ^newsletter$ [URL unfurl="true"]http://www.bniconnection.com/?content=newsletter/signup[/URL] [R]
RewriteRule ^support$ [URL unfurl="true"]http://www.bniconnection.com/?content=help/support_form[/URL] [R]
RewriteRule ^enroll$ [URL unfurl="true"]http://www.bniconnection.com/?content=enroll/step1[/URL] [R]
RewriteRule ^signup$ [URL unfurl="true"]http://www.bniconnection.com/?content=enroll/step1[/URL] [R]
RewriteRule ^tour$ [URL unfurl="true"]http://www.bniconnection.com/?content=help/tour1[/URL] [R]
RewriteRule ^faq$ [URL unfurl="true"]http://www.bniconnection.com/?region_id=1&content=help/faq[/URL] [R]
RewriteRule ^admin$ [URL unfurl="true"]http://www.bniconnection.com/?region_id=1&content=admin/login[/URL] [R]
RewriteRule ^payment$ [URL unfurl="true"]http://www.bniconnection.com/payments[/URL]
RewriteRule ^payments$ [URL unfurl="true"]http://www.bniconnection.com/?content=enroll/payments[/URL] [R]
RewriteRule ^affiliates$ [URL unfurl="true"]http://www.bniconnection.com/?content=misc/affiliates[/URL] [R]

RewriteRule ^chapter/([0-9]*)$ /chapter/$1/
RewriteRule ^chapter/([0-9]*)/$ /index.php?content=chapters/chapter_public_home&id=$1 [R=301,L]

RewriteRule ^region/([a-zA-Z0-9_]*)$ /region/$1/
RewriteRule ^region/([a-zA-Z0-9_]*)/$ /index.php?region=$1

Also, go to the apache documentation and look up the mod_rewrite engine for more details. It's a huge realm, almost a proverbial language in itself, and very powerful!
 
Yep, definately a post for the Apache forum ...

Add this line under your RewriteEngine On line:
Code:
RewriteRule ^admin/? - [L]
Tells Apache to leave /admin/ URL's untouched.

Guess I didn't help the situation by posting a response ... :(

Greg
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top