redirect first page

Permalink 1 user found helpful
How to redirect first page to subpage.

My site map:

- Site (is empty no content)
-- Home
---- page np1
---- page no2
---- page no3
-- About
-- Contact

First page is empty and there is no content, my first page is home, but when enter my www adres conretne5 default open Site. This is nonsense. How to redirect this to Home ?

 
DavidMIRV replied on at Permalink Reply
DavidMIRV
Home Page (Site in your setup) should be the default index page. Why not move your content from Home to Site?
pdm replied on at Permalink Reply
To understand my problem i have to show you my page:http://schima.pl/schima/

"Site" - default site, eneterd in setup, the site showing after you entered www adress.
"Home" - oryginal home page


http://schima.pl/schima/ this is default page after you enter www adres (copy of oryginal "home")
I want to have one home page, not two pages to update.

here is orginal home page:
http://schima.pl/schima/home/

In "Home" are subpages and I use autonavi to show subpages (menu on the left). When you open "Site", autonavi can't see subpages in "Home" because "Site" has own childrens (subpages) like home, contact and others, and there is no way to bypass this.

So I thing the easiest way is redirect from "Site" to "Home", but how ?

Other problem is that autonavi can't see the "Site". This can be bypass by add to sitemap link "home" which drive to "Site", but links can't have subpages and circle is closed. Conrete5 shuld have option to set up start page like others content systems.

Now i have 2 home pages which one is oryginal "Home" and "Site" is copy. On "Site" is bad left menu (copy of top menu). Also i have to update 2 home pages. this is nonsense.

Is there any one who know how to solve my problem ?

ps. Sorry for my bad english
frz replied on at Permalink Reply
frz
Just lose the site page and put the content on home. you don't need the two pages.
pdm replied on at Permalink Reply
what you mean saying "lose the site page" ? How can i lose the site page ? I can't move site page i can't delete it. One thing that i can is delete all content from first page and redirect it by javascript:

<script type="text/javascript">
window.location = "http://schima.pl/schima/home"
</script>
frz replied on at Permalink Reply
frz
move the stuff under home to be under what you're calling "site" now.
rename site to home.
done.
01005 replied on at Permalink Reply
..
pdm replied on at Permalink Reply
Add new content block and pres html buton in WYSIWIG editor (tiny) and put code there.

When you add new content block, you have to fast click stop button in your browser and exit edit mode with saving changes before the site redirect.

Here you can preview the javascript redirect in actionhttp://schima.pl/
jakubt replied on at Permalink Reply
I think you do not understand his problem - sorry. You solution does not allow to have the page structure he requires (specifically page no1, page no2, etc).

I have the same problem as he is. Concrete is trying to be very helpful (maybe too helpful) by "flattening" first two levels in navigation into one. Given this structure

Site
+ Home
++ page1
++ page2
+ About
+ Contact

it generates navigation like this:

Site
Home
* page1
* page2
About
Contact

This is convinient when your first page with content (here Home) does not have any subpages - then you can merge Site and Home without any problem. However in this case you obtain something like

Home
+ page1
+ page2
+ About
+ Contact

which gives this navigation

Home
page1
page2
About
Contact

which is clearly wrong. The aim is to have this navigation:

Home
*page1
*page2
About
Contact

which is very hard to do in concrete5 (without javascript, redirects and hiding pages in navigation)

Jakub
WebcentricLtd replied on at Permalink Reply
I was looking into this the other day. I have a solution but didn't use it in the end - it is exactly what Jakub has said above.

In the sitemap make your Homepage not visible in the autonav. Create a new empty homepage (this hompage is purely for the menu and will not hold content) and create the child pages from that.

Your menu will then stack ok but the homepage that shows in the menu will need redirecting to the real one - I used a 301 in the .htaccess.

I thought it too inelegant and clunky though so I just changed the menu to fit in with the way c5 works by default.
admin replied on at Permalink Reply
I want to redirect my concrete5 default toplevel page (called 'site' above) to a child page, but maybe I'd like to change which child it redirects to in the future. Also, the target child is a single page so I don't see how I could easily include the content on the 'site' page as a block or something.

Since I also want to rewrite (pretty) URLs to always have a slash at the end, I modified this code (http://www.concrete5.org/documentation/how-tos/developers/seo-tip-r... ) in the following way to redirect the home page to a child called 'translation'. (btw this has nothing to do with using concrete5 in multiple languages)
<?php
    if ($_SERVER['REQUEST_URI'] != '/')
    {
        if (substr($_SERVER['REQUEST_URI'],-1)!='/')
        {
            $newuri = $_SERVER['REQUEST_URI'].'/';
            Header( "HTTP/1.1 301 Moved Permanently" );
            Header( "Location: ". BASE_URL. $newuri);
        }
    }
    else
    {
        $newuri = preg_replace('#/$#','/translation/',$_SERVER['REQUEST_URI']);
        Header( "HTTP/1.1 301 Moved Permanently" );
        Header( "Location: ". BASE_URL. $newuri);

It seems to work fine. Does anybody see any problems with this, that I may have overlooked?
Tony replied on at Permalink Reply
Tony
one of my customers has something very similar script and it's causing all post/request variables to disappear from every request. I commented this out and it started working again.
admin replied on at Permalink Reply
@Tony what exactly did you comment out? The whole script? Then how did you provide your customer with the functionality the script was delivering before?

I do have some hickups when editing pages, and I suspect it is caused by my coding. Although the edited page doesn't reload properly, the changes are all processed correctly and reflected in the frontend immediately.
Marco5 replied on at Permalink Reply
I have the same issue but solved it by putting in the Page Redirect Block on the 'Home' page.

http://www.concrete5.org/marketplace/addons/redirect1/...