Jump to:

23545 Posts in 19310 Topics by 2888 members

General Questions

SilverStripe Forums » General Questions » Static Publisher

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: 627 Views
  • cumquat
    Community Member
    198 Posts

    Static Publisher Link to this post

    Hi there i'm trying to speed up some of my 3.1 sites and i'm looking at using the static publisher, i have followed the instructions on the docs but they mention adding some code to the .htaccess file, there is a link but that goes to a restricted access page. Do i need to add to the .htaccess for static publisher to work. below is my current set up.

    <Files *.ss>
       Order deny,allow
       Deny from all
       Allow from

    <Files web.config>
       Order deny,allow
       Deny from all

    # This denies access to all yml files, since developers might include sensitive
    # information in them. See the docs for work-arounds to serve some yaml files
    <Files *.yml>
       Order allow,deny
       Deny from all

    ErrorDocument 404 /assets/error-404.html
    ErrorDocument 500 /assets/error-500.html

    <IfModule mod_alias.c>
       RedirectMatch 403 /silverstripe-cache(/|$)
       RedirectMatch 403 /vendor(/|$)
       RedirectMatch 403 /composer\.(json|lock)

    <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteBase '/'

       RewriteCond %{REQUEST_URI} ^(.*)$
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_URI} !\.php$
       RewriteRule .* framework/main.php?url=%1&%{QUERY_STRING} [L]



  • martimiz
    Forum Moderator
    1088 Posts

    Re: Static Publisher Link to this post

    I never noticed Static Publisher being moved to its own module, but obviously, for 3.1, this is the case:


    I guess you'll find the necessary info in the docs section...

  • guci0
    Community Member
    1 Post

    Re: Static Publisher Link to this post

    Uff – works!

    But I am wondering about a translatable module.
    Is possible to join StaticPublisher&Translatable to working together ?

    Best regards!

    P.S. I thought that I'm already joined forum, hmm...

    EDIT: It's works, but only via Publish button, via allPagesToCache() doesn't.
    $pages = SiteTree::get(); returns only Translatable::set_default_locale('lang') (records / pages);

    How to fix this?

    EDIT 2:

    Does the trick, for now:

    Translatable::disable_locale_filter(); and Translatable::enable_locale_filter();

    EDIT 3:

    Another problem is: allPagesToCache() when we have enabled
    URLSegmentFilter.default_allow_multibyte, there is no cache file, for example:

    Publishing page 2/18: /localhost/%D0%B4%D0%BE%D0%BC%D0%B0/ <- fired, but file of cache is lost, don't write.

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.