Redirect main page to subpage


#1

Hi,

I am trying to redirect a main page (top-level nav page) to a subpage that is, when you click a first level page on the main navigation menu to open the subpage.

For example, I am looking for “Education” (http://injuredathletes.org/education/) to redirect to “Heat Illness” (http://injuredathletes.org/education/hydrate/).

I’ve tried 301 redirecting /education to /education/hydrate/ and nothing… I don’t really want to use a script to redirect as there are SEO ranking implications. Can you advise?


#2

One thing to note when using the redirect tool in Zesty is that it does not account for trailing forward slashes. /education and /education/ are two separate urls. That being said it’s important to have a redirect for both variations.

Also when setting up a redirect in Zesty you can not have a page at the path you want to redirect from. Meaning there can not be a http://injuredathletes.org/education/ page. Otherwise it serves that page instead of redirecting.


#3

Hi Stuart - thanks for your response!

I actually added a 301 redirect for both /education & /education/, but for some reason they aren’t showing up in my “Current Redirects” but say “Already exists in database” when I try to re-add them.

Maybe a better explanation of what I’m trying to do is what currently exists on the site in both the “About” & “Athletes Saving Athletes” nav. I’m looking for “Education” & “Heat Illness” to show the same content, just as “About”/“Our Story” and “Athletes Saving Athletes”/“About Athletes Saving Athletes” currently function. Basically, the main nav is just a the clickable page and safety route for the user to get to the page if they do not hover over dropdown and select the first page. Does that make sense?


#4

Looking at the site it seems the difference between how your achieving the result of the “About”/“Our Story” pages and “Education” & “Heat Illness” is that the former are just two separate links to the same url, no redirect. While “Education” and “Heat Illness” are two separate urls and you need the top level “Education” page to be able to parent the “Heat Illness” sub page.

I can see 2 options to solving the problem.

  1. Setup the “Education” page to have link or input that you then use in your Parsley template to do a window.location redirect.

  2. Restructure your urls and or content. Not really a solution to the provided constraints but what I’d personally recommend. Stick with just a top level if your only going to have one page of content. You can always add sub-pages if that content changes later.


#5

The About/Our Story is setup as so:

Does this option exist anymore? (it was setup so long ago!)

If the above cannot be done -
For Option #1, is this the script I’d use?

window.location.replace("{{ truepath({page.redirects_to}) }}");

If so, where would I add the redirected page URL (http://injuredathletes.org/education/hydrate/)


#6

Figured out that in order to achieve the redirect, you’d use the following script, where truepath({page.redirects_to}) dictates either your internal link or zid.

If you use zid, it would look like: truepath({900})
To find zid, go to the page you want to redirect and copy the 3 digit # in the URL

If you use an internal link, first add an internal link to the page in the Config section, then add to the Editor: truepath({page.internal_link})

window.location.replace("{{ truepath({page.redirects_to}) }}");