RevCMS hiding /index

Wolverine

Member
Aug 1, 2014
87
3
I'm trying to hide my index name from the homepage, so it will display as domain.com/ instead of domain.com/index

I'm using IIS..

Web.config:
 

MayoMayn

BestDev
Oct 18, 2016
1,423
683
RevCMS? Go to class.html.php, and then where it says if($file != null) add an else statement where it gets the index page like the rest of the code gets a page.
I'm on mobile rn so cant really describe it any further.

Sent from my SM-G928F using Tapatalk
 

Wolverine

Member
Aug 1, 2014
87
3
RevCMS? Go to class.html.php, and then where it says if($file != null) add an else statement where it gets the index page like the rest of the code gets a page.
I'm on mobile rn so cant really describe it any further.

Sent from my SM-G928F using Tapatalk
Code:
<?php

namespace Revolution;
if(!defined('IN_INDEX')) { die('Sorry, you cannot access this file.'); }
class html implements iHTML
{

    private $html;

    final public function get($file)
    {
        global $template, $_CONFIG;
        
        if($file != null && ctype_alnum($file))
        {
            if(file_exists('app/tpl/skins/'.$_CONFIG['template']['style'].'/' . $file . '.php'))
            {
                ob_start();
                include('app/tpl/skins/'.$_CONFIG['template']['style'].'/' . $file . '.php');
                $this->html .= ob_get_contents();
                ob_end_clean();
                  
                    $this->setHTML();
            }
            else
            {
                $this->get('404');
            }
        }
        else
        {
            header('Location: '.$_CONFIG['hotel']['url'].'/index');
            exit;
        }

    }
    
    final public function getHK($file)
    {
        global $template, $_CONFIG;
        
        if($file != null)
        {
            if(file_exists('../app/tpl/skins/'.$_CONFIG['template']['style'].'/hk/' . $file . '.php'))
            {
                ob_start();
                require_once('../app/tpl/skins/'.$_CONFIG['template']['style'].'/hk/' . $file . '.php');
                $this->html .= ob_get_contents();
                ob_end_clean();
            
                $this->setHTML();
            }
            else
            {
                $this->getHK('404');
            }
        }
        else
        {
            $this->getHK('dash');
        }
    }
        
    final public function setHTML()
    {
        global $template;
        $template->tpl .= $this->html;
        unset($this->html);
    }


}
?>
How do I do this?
 

MayoMayn

BestDev
Oct 18, 2016
1,423
683
header() && exit(); should be replaced with "$this->get('index');"

Sent from my SM-G928F using Tapatalk

Did it work for you?

Sent from my SM-G928F using Tapatalk
 
Last edited by a moderator:

Core

Member
Nov 10, 2016
356
138
Or you can just go to global.php and do the following

$_GET["url"] = (isset($_GET["url"]) && !empty($_GET["url"])) ? $_GET["url"] : "index";

or add empty string to switch case
 

MayoMayn

BestDev
Oct 18, 2016
1,423
683
Or you can just go to global.php and do the following

$_GET["url"] = (isset($_GET["url"]) && !empty($_GET["url"])) ? $_GET["url"] : "index";

or add empty string to switch case
Just way easier solution to add an else statement if the file is null lol.

Sent from my SM-G928F using Tapatalk
 

Core

Member
Nov 10, 2016
356
138
Just way easier solution to add an else statement if the file is null lol.

Sent from my SM-G928F using Tapatalk

Not at all, requires him to understand how revcms handles the request, which he obviously doesn't know as if he did then this wouldn't of been posted..
 

MayoMayn

BestDev
Oct 18, 2016
1,423
683
Not at all, requires him to understand how revcms handles the request, which he obviously doesn't know as if he did then this wouldn't of been posted..
Its still easier. Read instead of just arguing about something you obviously never bothered to read properly.

Sent from my SM-G928F using Tapatalk
 

Users who are viewing this thread

Top