How to set a single page at the root of my sitemap?

Permalink 1 user found helpful
I've created a single page. Now I want to put this single page at the root of my sitemap.

What is the best way to do this?

P.S.: I'm using concrete 5.7.5.6

 
WebcentricLtd replied on at Permalink Reply
Hello, are you saying you want the single page to actually replace your homepage?

If so I don't really think that is possible - if someone knows better please chip in and contradict me.

If you want the specific functionality of the single page as your homepage I would investigate creating a specific page type for your homepage and create a controller for that page type using the logic from your single page controller. I've never actually attempted this so there may be some pitfalls I don't know about.
VonUniGE replied on at Permalink Reply
Maybe is there a clean way of doing a redirect from index.php to the single page?

Preferably without using Apache configuration files.
WebcentricLtd replied on at Permalink Reply
hi,
you could do a check for the cID of the page right at the top of your included header and if the cID == 1 (meaning homepage) then do something like:


header("HTTP/1.1 301 Moved Permanently");
header("Location:http://www.mydomainname/singlepagepath");...

But - I have just written this here as on off-the-cuff thought. I haven't fully thought through the implications of this so really I would test this on a dev website first to see if anything funny happens.
WebcentricLtd replied on at Permalink Reply
of course if you do do this then your website homepage will not behttp://www.mydomainname.com it would behttp://www.mydomainname.com/myotherpage...
VonUniGE replied on at Permalink Reply
I've found another way of doing a redirect:
$page = Page::getByID(1);
Redirect::page($page)->send();

http://www.concrete5recipes.com/tricks/redirect-to-a-page...

Is it better? What do you think?