PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Tue Sep 25, 2018 1:02 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Tue Nov 24, 2009 8:49 pm 
Offline
DevNet Evangelist

Joined: Tue Dec 21, 2004 6:00 pm
Posts: 6267
Location: Winnipeg
I alwasy run into this issue and can never find my old threads...personal KBASE me thinks :)

ANyways I have index.php in my root directory looks something like:

Syntax: [ Download ] [ Hide ]
RewriteEngine on
RewriteBase /
 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,NC,L]


One of the sub-directories is 'admin' which houses various applications which also need to use .htaccess but their own so as to be compartmenaltized (I should be able to drop in an admin application not have to notify the .htaccess in root to forward requests for directory 'admin/something' to it's index.php file.

So the structure lookes like

Syntax: [ Download ] [ Hide ]
index.php
.htaccess
admin
admin/forum/.htaccess
admin/forum/index.php


Unfortunately the later doesn't seem to want to work as the root index.php is being invoked and looking for a resource which doesn't exist.

Anyway around this issue, considering the drop in requirements?

Cheers,
Alex


Top
 Profile  
 
PostPosted: Wed Nov 25, 2009 5:36 am 
Offline
Forum Newbie

Joined: Wed Nov 25, 2009 5:20 am
Posts: 3
Change your ROOT .htaccess to:


RewriteCond %{REQUEST_URI} !^admin
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,NC,L]

this says... if the URI doesnt start with 'admin' ... go to index.php, otherwise go to the admin folder and process the request as normal (at which point your admin directory .htaccess would take over)


Top
 Profile  
 
PostPosted: Wed Nov 25, 2009 7:29 pm 
Offline
DevNet Evangelist

Joined: Tue Dec 21, 2004 6:00 pm
Posts: 6267
Location: Winnipeg
Quote:
this says... if the URI doesnt start with 'admin' ... go to index.php, otherwise go to the admin folder and process the request as normal (at which point your admin directory .htaccess would take over)


EDIT | I tried this but still doesn't work:

Syntax: [ Download ] [ Hide ]
http://www.pcspectra.com/admin/system/a ... /.htaccess
 
RewriteEngine on
RewriteBase /
 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,NC,L]




Syntax: [ Download ] [ Hide ]
http://www.pcspectra.com/.htaccess
 
RewriteEngine on
RewriteBase /
 
RewriteCond %{HTTP_HOST} ^pcspectra.com [NC]
RewriteRule ^(.*)$ http://www.pcspectra.com/$1 [L,R=301]
 
RewriteCond %{REQUEST_URI} !^admin
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,NC,L]


Any ideas?

Cheers,
Alex


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group