Jump to:

22996 Posts in 11844 Topics by 2828 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: 492 Views
  • cumquat
    Avatar
    Community Member
    189 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.

    ### SILVERSTRIPE START ###
    <Files *.ss>
       Order deny,allow
       Deny from all
       Allow from 127.0.0.1
    </Files>

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

    # 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
    </Files>

    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>

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

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

    regards

    Mick

  • martimiz
    Avatar
    Forum Moderator
    1038 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:

    https://github.com/silverstripe-labs/silverstripe-staticpublisher

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

  • guci0
    Avatar
    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.

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