Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » mod_rewrite in .htaccess to exclude a sub-directory.

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

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

Page: 1
Go to End
Author Topic: 4887 Views
  • Bruce
    Avatar
    Community Member
    29 Posts

    mod_rewrite in .htaccess to exclude a sub-directory. Link to this post

    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.

  • Bruce
    Avatar
    Community Member
    29 Posts

    Re: mod_rewrite in .htaccess to exclude a sub-directory. Link to this post

    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

    4887 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.