仝 tóng

How to change WeCenter home page

WeCenter is a social question and answer knowlege community, its default home page is "explore", if you want to change its home page to "topic" or a page, please follow me next:

  1. system/core/uri.php

line 25, change 'app_dir' => 'explore', to 'app_dir' => 'page', //page is your willing change home page or "topic" or article.

  1. you can skip this step if you want to change "explore" to "topic" or article, this step is for "page/example"

create a example page in you backend, and enable it on.

app/page/main.php

line 35, change HTTP::error_404(); to HTTP::redirect('/page/example');

more: if you want visitor's first view page is "page/example", and view the "explore" after login, you can add some code after line 36:

if ($this->user_id) // this is meanning when user login will redirect to explore

{

HTTP::redirect('/explore/');

}

  1. go to your wecenter backend and enable rewrite, this need you your server support this function.

add /page/example===/ in your custome rule and save it

you will find the "page/example " will be your home page, and will redirect to explore after login.

发表新评论