Jump to:

3443 Posts in 1030 Topics by 871 members

Template Questions

SilverStripe Forums » Template Questions » dev mode caching? issue for 404 Page (Page Type Error Page)

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

Page: 1
Go to End
Author Topic: 1323 Views
  • Nils73
    Avatar
    Community Member
    3 Posts

    dev mode caching? issue for 404 Page (Page Type Error Page) Link to this post

    Hello folks,

    I recently deployed a Silverstripe website. Everything is fine so far, but the <% base_tag %> - Control isn't working properly for my 404 page. It always prints out the url of my develop-system!? If I use the command echo Director::absoluteBaseURL() directly (within the Controller class), I get the right information. I also get the right information, when I run the site in dev mode, it's working perfect and printing the right url. Of course I don't want to run the page in dev mode ...

    So my question is, why is there a different output of the <% base_tag %> - Control depending on dev mode? What can I do to get the right output for 404 when dev mode is deactived?

    Any hints?

    Nils

  • Fuzz10
    Avatar
    Community Member
    787 Posts

    Re: dev mode caching? issue for 404 Page (Page Type Error Page) Link to this post

    So you are saying on a live server , the Base_Tag spits out your development system URL ? Weird ? AFAIK , this URL is completely dynamic.

    What does your .htaccess look like ?

  • Nils73
    Avatar
    Community Member
    3 Posts

    Re: dev mode caching? issue for 404 Page (Page Type Error Page) Link to this post

    yep, really weird, and only for page type Error Page!

    Despite of some php5 initialization .htaccess is standard:

    AddType x-mapp-php5 .php
    AddHandler x-mapp-php5 .php

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

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_URI} !html*
    RewriteCond %{REQUEST_URI} !_ts_temp*

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

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

  • Willr
    Avatar
    Forum Moderator
    5497 Posts

    Re: dev mode caching? issue for 404 Page (Page Type Error Page) Link to this post

    The 404 page is generated in the Assets Section (so it can display without hitting the DB if necessary). If you have moved the site from dev -> live this file was probably copied and not remade. To regenerate it delete the 404.html file from assets/ if you have one. Hopefully this is the only issue!

  • Nils73
    Avatar
    Community Member
    3 Posts

    Re: dev mode caching? issue for 404 Page (Page Type Error Page) Link to this post

    Thanks for the hint. Deleting didn't work, but knowing where to look, we simply changed the basepath there .

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