Jump to:

23367 Posts in 18143 Topics by 2863 members

General Questions

SilverStripe Forums » General Questions » how to set .htacess for static pages

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 662 Views
  • Stephan
    Avatar
    Community Member
    55 Posts

    how to set .htacess for static pages Link to this post

    Hi experts,
    we do have static pages where our customer can see the statistics of his page
    He can access them with http://<domain>/statistic (symbolic link in webserver).
    But now sapphire wants to take care of this
    How do I have to change my .htaccess to do this ?

    I have tried several configrations which worked
    perfect for my statstics site, but then /admin didn't work any longer.

    TIA Stephan

  • Hamish
    Avatar
    Community Member
    712 Posts

    Re: how to set .htacess for static pages Link to this post

    You need to exclude /statistics urls being passed to sapphire. After this line:

    RewriteCond %{REQUEST_URI} !(\.gif)|(\.jpg)|(\.png)|(\.css)|(\.js)|(\.php)$

    Add this:

    RewriteCond %{REQUEST_URI} !(\\statistic)

    That is, if the URL contains "\statistic", don't rewrite the url to sapphire.

  • Stephan
    Avatar
    Community Member
    55 Posts

    Re: how to set .htacess for static pages Link to this post

    Hi,
    thanks, but this doesn't work

    I get the 404 page (page not found) from silverstripe.

    Stephan

  • Hamish
    Avatar
    Community Member
    712 Posts

    Re: how to set .htacess for static pages Link to this post

    In that case, the rule is incorrect. I'm not an expert in rewriting rules, so have a look at the apache module documentation. Basically you just want to add a condition so that if the path is to your symlink, it is ignored.

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