Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 mod_rewrite help
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

phy1729
Average Member

USA
589 Posts

Posted - 19 February 2008 :  14:46:09  Show Profile
I've gotten tired of creating soft redirects for my include files, so I've decided to use mod_rewrite if no one has a better idea. My situation:
I have a password protected admin directory. Let's call it "/foo/".
All my includes are at the HTTP root. Let's call it "/".
I have in include called inc_func_db.php in / but I need to access it from /foo/.
I don't want to make /foo/inc_func_db.php and code that to link to /inc_func_db.php because I have multiple includes.
If all includes are in the format inc_<some-name>.php would
RewriteRule   ^inc_([^/]+).php$  /inc_$1.php  [R]
work? Or is there a better way?

Edit:Spelling fix

Edited by - phy1729 on 19 February 2008 15:05:11

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 19 February 2008 :  15:14:44  Show Profile  Visit HuwR's Homepage
probably not the best place to be asking php/apache questions questions
Go to Top of Page

phy1729
Average Member

USA
589 Posts

Posted - 19 February 2008 :  15:21:23  Show Profile
Only apache. But I figured I'd try here before IRC.
Go to Top of Page

phy1729
Average Member

USA
589 Posts

Posted - 19 February 2008 :  15:35:51  Show Profile
An IRC user has told me mod_rewrite is of no use. Ah well. I'll post what I do to be of future use to other people.
Go to Top of Page

SiSL
Average Member

Turkey
671 Posts

Posted - 20 February 2008 :  04:11:37  Show Profile  Visit SiSL's Homepage
Why would you write a mod_rewrite about something people will never see (eg. includes)?

CHIP Online Forum

My Mods
Select All Code | Fix a vulnerability for your private messages | Avatar Categories W/ Avatar Gallery Mod | Complaint Manager
Admin Level Revisited | Merge Forums | No More Nested Quotes Mod
Go to Top of Page

phy1729
Average Member

USA
589 Posts

Posted - 20 February 2008 :  10:21:18  Show Profile
To make it easier for me. Right now I'm using ../filename but I still want a better way. I really want the file system to handle the directory change.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.16 seconds. Powered By: Snitz Forums 2000 Version 3.4.07