Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

mod_rewrite in .htaccess to exclude a sub-directory.


Reply

2 Posts   4938 Views

Avatar
Bruce

11 September 2008 at 9:09pm Community Member, 29 Posts

Hi,
I know this is not a silverstripe-specific issue, but someone may have struck this.

I am wanting to make a modification to the mod_rewrite rules in the .htaccess file to prevent re-write engine from operating inside a sub-directory.

The situation is that the silverstripe content is in my base directory, and I am operating phplist (http://phplist.com) from a sub-directory.
The phplist application generally calls new pages in it's own directory with the directory name only, not a specific file name. (e.g. http;//<domain>/phplist//admin/?page=list )
These calls are unfortunately captured by the mod_rewite & a silverstripe page not found is returned.

I have tried various RewriteCond statements such as:
RewriteCond {REQUEST_URI} !^phplist
but don't seem to be able to get it right.

Avatar
Bruce

11 September 2008 at 10:10pm (Last edited: 11 September 2008 10:12pm), Community Member, 29 Posts

Nothing like posting a question to sharpen the focus!

I have used the rule:

RewriteCond %{REQUEST_URI} !/phplist*


and it works fine!

The only drawback is that

http://<domain>/phplist/admin/


works, but

http://<domain>/phplist/admin


doesn't ... the trailing slash is needed to get started.

//Bruce