Hiya guys,
I need some help (+REP of course!), you see how Habbox has like pages https://habbox.com/#/Home how do you make it so like /#/home generates home etc kinda hard to explain, any ideas?
Logan

Hiya guys,
I need some help (+REP of course!), you see how Habbox has like pages https://habbox.com/#/Home how do you make it so like /#/home generates home etc kinda hard to explain, any ideas?
Logan
ex-hxl manager
ex-event organizer
ex-gfx designer
ex-competition staff
ex-content staff
OFWGK†Δ
You mean a redirect? So you type in www.habbox.com/home and it takes you to the URL www.habbox.com/#/home ?
EDIT: I don't think that's what you're on about lol, apologies if it's not I don't fully understand what you mean
Last edited by Mark; 24-04-2011 at 12:17 AM.
Do you mean like...
http://www.domain.com/anything_here_you_want/home
and it takes you to the home page?
If so it's done by making / editing your .htaccess file and putting in something like this
Should work :sCode:RewriteEngine on RewriteRule ^/([^/\.]+)/home/?$ /home.html [L]
Joe
I don't think the hash does anything at all, I've been typing in websites such as http://www.bt.com/#/ & http://www.youtube.com/#/. They all load the companies home pages!
Try it with yours if that's what your aiming for.
example: www.yourwebsiteurl.com/#/
I believe Habbox uses Ajax to load the pages in frames, But you could get the same effect by using PHPIncludes. (/index.php=home, /index.php=page etc)
ex-hxl manager
ex-event organizer
ex-gfx designer
ex-competition staff
ex-content staff
OFWGK†Δ
I think he means using the GET argument to load the correct page. For example:
To view these, you would navigate to: PAGENAME.php?action=aboutus or PAGENAME.php?action=products .PHP Code:<?PHP
if (isset($_GET['action'])){
if ($_GET['action'] == 'aboutus'){
Echo "We are a company dedicated to providing you with quality food at affordable prices.";
}else if ($_GET['action'] == 'products'){
Echo "Our product range:";
}
}
?>
I hope I've helped.
http://www.habboxforum.com/showthrea...t=43037&page=1
Use the second method and you can dynamically choose which page to load using the doohickeys (Forgot their namess OK?!?!).
I think there's a good link for a JS one as well, I'll look for that also... brb.
Edit, found it, some reassembly required for it to work as you'd like:
http://www.dynamicdrive.com/dynamici...jaxcontent.htm
Last edited by Chippiewill; 03-05-2011 at 08:58 PM.
Chippiewill.
The contents of the URL past the hashtag (#) don't get sent to the webserver, and are only client side. Because of this Habbox is able to detect changes in the URL past # dynamically by checking for a change 10 times a second and when one's detected we use AJAX (.load() in jQuery to be specific) to grab the specified page and stick the contents in a div.
Habbox.com/#/page/variable/value/variable2/value2
works out to be
page.php?variable=value&variable2=value2
If we used mod rewrite in lieu of our Javascript clean urls spinoff you would have to reload the webpage each time you click a link which would mean widgets like the Habbox Live radio player wouldn't work.
How to load content dynamically using AJAX:
http://api.jquery.com/load/
Habbox use our own self written functions to accomplish hashtag navigation, but there are jQuery plugins available if you wanted to use one of them:
http://plugins.jquery.com/plugin-tags/hash
I'm not crazy, ask my toaster.
Want to hide these adverts? Register an account for free!