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
What is the best way to do this?
P.S.: I'm using concrete 5.7.5.6
Maybe is there a clean way of doing a redirect from index.php to the single page?
Preferably without using Apache configuration files.
Preferably without using Apache configuration files.
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.
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.
of course if you do do this then your website homepage will not behttp://www.mydomainname.com it would behttp://www.mydomainname.com/myotherpage...
I've found another way of doing a redirect:
http://www.concrete5recipes.com/tricks/redirect-to-a-page...
Is it better? What do you think?
$page = Page::getByID(1); Redirect::page($page)->send();
http://www.concrete5recipes.com/tricks/redirect-to-a-page...
Is it better? What do you think?
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.