Jump to:

4938 Posts in 16827 Topics by 1490 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » weird .htaccess rule RedirectMatch

Getting SilverStripe up and running on your computer and on your web server.

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

Page: 1
Go to End
Author Topic: 519 Views
  • freakout
    Avatar
    Community Member
    49 Posts

    weird .htaccess rule RedirectMatch Link to this post

    can somebody tell me what's the purpose of the .htaccess rule is:

    RedirectMatch 403 /silverstripe-cache(/|$)

    even the apache doc cannot clearify this.
    This rule is inserted into .htaccess by install.php

  • simon_w
    Avatar
    Forum Moderator
    473 Posts

    Re: weird .htaccess rule RedirectMatch Link to this post

    It denies access to anyone trying to access the silverstripe-cache folder (if one exists)

  • freakout
    Avatar
    Community Member
    49 Posts

    Re: weird .htaccess rule RedirectMatch Link to this post

    With 2 parameters this statement is completely nonsense and does nothing.
    The 304 status is interpreted as a matching condition this way!
    See apache docs for setting up this correctly.

  • simon_w
    Avatar
    Forum Moderator
    473 Posts

    Re: weird .htaccess rule RedirectMatch Link to this post

    The status argument is a 403, thus the URL to redirect to must be omitted (as detailed in the docs for Redirect, which RedirectMatch is equivalent to beyond regex support). The statement is perfectly correct.

  • freakout
    Avatar
    Community Member
    49 Posts

    Re: weird .htaccess rule RedirectMatch Link to this post

    Sorry - your are right - i did miss to read the Redirect docs.
    But i'm still confused. Why should an URL of /silverstripe-cache gain access to Path /tmp/silverstripe-cache-home-... ?

  • simon_w
    Avatar
    Forum Moderator
    473 Posts

    Re: weird .htaccess rule RedirectMatch Link to this post

    It doesn't, but you can have a silverstripe-cache folder in your site root instead of the one in /tmp (which is a fairly common practice on shared hosts). This rule is to stop access to that folder.

    519 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.