I am using Kirby as CMS only, is there a way to change the home page to other than home.php?
kirby is on a folder on the root of mydomain.com
http://mydomain.com/kirby/home -> gets json home content
how do I make this redirect whitout losing the above?
http://mydomain.com/kirby/ to kirby's panel?
But http://mydomain.com/kirby/
already calls the home page, no need to add home
to the URL. Kirby 2.3.0 automatically redirects from http://mydomain.com/kirby/home
to http://mydomain.com/kirby/
anyway.
If you just want to rename the home folder, you can do that in your config.php.
c::set('home', 'something-else');
1 Like
What do you mean by “as CMS only”? Kirby is a CMS, so you can’t actually use it as anything else.
To be honest I also don’t really understand what you are trying to do? Do you just want to use a different template for the page /home
? If so, you just need to rename the text file inside /content/home/home.txt
to the template name you need.
Also please note that the home page can be accessed from http://mydomain.com/kirby/
without the folder name of the page. It’s a home page after all.
As I wrote above, this URL is served by the home page. You can however use a route to redirect:
c::set('routes', array(
array(
'pattern' => '/',
'action' => function() {
go('panel');
}
)
));
1 Like
I think what @Chris_Pugliese means is that he uses Kirby to manage contents and then provide the content as json to be used somewhere else.
Sorry for the bad formulated question.
@texnixe got it right, I am only using Kirby as json provider
My problem is that I have this:
-
domain.com/kirby = this shows the home template content (json)
-
domain.com/kirby/home = also shows home template content (json), <- correct!
I guess a better question is:
how do I make domain.com/kirby (1) redirect to domain.com/kirby/panel/? whithout losing access to (2)
@texnix, this seems to work, but shows a blank page, how do I redirect to panel?
c::set('home', 'something');
Ok, I did a quick test:
If you set the home page to another one, let’s say about (while leaving the home folder intact)
c::set('home', 'about');
Then you could use the following route:
c::set('routes', array(
array(
'pattern' => '/',
'action' => function() {
header::redirect('http://domain/kirby/panel');
}
)
));
to redirect to the panel.
The home URL would still work, as well as any other folders. To be tested some more.
1 Like
seems to work,
c::set('home', 'redirect');
I created a ‘redirect’ folder on content
and for its template:
<?php header( 'Location: /kirby/panel' ) ; ?>
Thanks a lot!