Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visualiser page statique non active > page blanche #104

Closed
pluxml opened this issue Jul 23, 2015 · 0 comments
Closed

Visualiser page statique non active > page blanche #104

pluxml opened this issue Jul 23, 2015 · 0 comments
Labels

Comments

@pluxml
Copy link
Collaborator

pluxml commented Jul 23, 2015

Message d'erreur affichage lorsqu'on essaye d’accéder à une page statique non active

Solution (fichier: core/lib/class.plx.motor.php)
Remplacer dans plxMotor la partie qui traite les pages statiques dans prechauffage() par le code suivant:

        elseif($this->get AND preg_match('/^static([0-9]+)\/?([a-z0-9-]+)?/',$this->get,$capture)) {

            $this->cible = str_pad($capture[1],3,'0',STR_PAD_LEFT); # On complété sur 3 caractères

            if(!isset($this->aStats[$this->cible]) OR !$this->aStats[$this->cible]['active']) {
                $this->error404(L_UNKNOWN_STATIC);
            } else {
                if(!empty($this->aConf['homestatic']) AND $capture[1]){
                    if($this->aConf['homestatic']==$this->cible){
                        header('Status: 301 Moved Permanently', false, 301);
                        header('Location: '.$this->urlRewrite());
                        exit();
                    }
                }
                if($this->aStats[$this->cible]['url']==$capture[2]) {
                    $this->mode = 'static'; # Mode static
                    $this->template = $this->aStats[$this->cible]['template'];
                } else {
                    header('Status: 301 Moved Permanently', false, 301);
                    header('Location: '.$this->urlRewrite('?static'.intval($this->cible).'/'.$this->aStats[$this->cible]['url']));
                    exit();
                }
            }
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

0 participants