Parcourir la source

+ Redirect to index page

If not configured in .htaccess or nginx configuration
Visman il y a 6 ans
Parent
commit
4e339956be
3 fichiers modifiés avec 7 ajouts et 3 suppressions
  1. 3 1
      app/Controllers/Routing.php
  2. 3 1
      app/Models/Pages/Auth.php
  3. 1 1
      app/Models/Pages/Redirect.php

+ 3 - 1
app/Controllers/Routing.php

@@ -59,7 +59,9 @@ class Routing
         // просмотр разрешен
         if ('1' == $user->g_read_board) {
             // главная
-            $r->add('GET', '/', 'Index:view', 'Index');
+            $r->add('GET', '/',           'Index:view', 'Index');
+            $r->add('GET', '/index.php',  'Redirect:toIndex');
+            $r->add('GET', '/index.html', 'Redirect:toIndex');
             // правила
             if ('1' == $config->o_rules && (! $user->isGuest || '1' == $config->o_regs_allow)) {
                 $r->add('GET', '/rules', 'Rules:view', 'Rules');

+ 3 - 1
app/Models/Pages/Auth.php

@@ -85,7 +85,9 @@ class Auth extends Page
     /**
      * Подготавливает массив данных для формы
      *
-     * @param array $args
+     * @param string $username
+     * @param mixed $save
+     * @param string $redirect
      *
      * @return array
      */

+ 1 - 1
app/Models/Pages/Redirect.php

@@ -13,7 +13,7 @@ class Redirect extends Page
      */
     public function toIndex()
     {
-        return $this->page('Index')->message('Redirecting to index');
+        return $this->page('Index'); //->message('Redirecting to index');
     }
 
     /**