PDA

View Full Version : Redirect



moose86
02-11-2014, 08:10 PM
Hi Guys, I'm not sure if this is in the correct forum, but here it goes anyway:

I have a page with a div (lets call this div = main) which loads every page (www.domain.co.uk/page.html) when you click on the button on the nav bar,

Is there a way to add a redirect to a custom page for when the full address is entered into the address bar, but stop the redirect if the page loads in 'main'

Hope i have made that understandable to you all lol

Thanks :)

molendijk
02-11-2014, 09:24 PM
I don't quite understand what you want.
Do you want to not only load 'page.html' in the div when the link for that page is activated in the nav bar but also load 'page.html' in the div when 'www.domain.co.uk/page.html' is entered in the address bar?

moose86
02-11-2014, 09:34 PM
Do you want to not only load 'page.html' in the div when the link for that page is activated in the nav bar but also load 'page.html' in the div when 'www.domain.co.uk/page.html' is entered in the address bar?

That would be great as people could share exactly that page, but if that is not possible then just a redirect to a custom error page will do, but I really like your idea :)

molendijk
02-11-2014, 10:28 PM
Well, it's possible, see this (http://mesdomaines.nu/eendracht/hashchange). I elaborated the idea here (http://wierdenland.nl).

moose86
02-12-2014, 01:55 PM
Hi molendijk,

maybe I am dumb but I cant seem to fathom out where to add the code, it looks like (looking at your source code) that you have made every 'page.html' the same (with the banner/footer.etc) im sure I am missing something but i dont know what, could you help me add this code please?

Thanks :)

molendijk
02-12-2014, 02:41 PM
No, you are not dumb. The reason why you only see the source of the main page has to do with the hashchange-technique.
Just exactly follow the instructions in the example (http://mesdomaines.nu/eendracht/hashchange) I gave you.

moose86
02-12-2014, 03:00 PM
ok, ill give it a good go, will let you know :)

moose86
02-12-2014, 03:26 PM
right, i have done that, it does work in the respect that it displays the index.html (main page with content div) but it displays the landing page within the target div and not the page that is put in the address bar si when i click on button2 in the nav bar, it does not load #page2.html, it only stays on the default page #page1

molendijk
02-12-2014, 04:05 PM
Can you give me a testsite, or the sources of all your pages?

moose86
02-12-2014, 04:21 PM
can I have your email please as i dont want them to be publicly shared as they are test urls?

molendijk
02-12-2014, 05:35 PM
You can go to this site (http://www.mesdomaines.nu/lesserknownclassicalmusic/?contact.html) to contact me.
I may not be able to answer you immediately as I'm quite busy right now. But I promise to react.

moose86
02-19-2014, 07:11 PM
Ok, I have figured out how to do this, i have added and automatic changing accordion to the page, it works when I load page.php but not when it is within the target div (#page.php) do you know why this is not working? i have added all the <script> tags to the index page, but it still doesn't want to work

This is the accordion used: http://www.madeincima.it/en/articles/resources-and-tools/easy-accordion-plugin/

molendijk
02-19-2014, 10:19 PM
It's hard for me to see the cause of the problem without a real online example. Can't you put it at a hidden web location only known to you and me?
You could also try to put the script for the accordion directly in the head of the page containing the div and see what happens (although this should not be a requirement).