Let's say I have the following link:
www.blahblah.com/#!?page=index
How can I convert it to one of the following:
www.blahblah.com/#!/index
(this one should be made with mod_rewrite)www.blahblah.com/ajax/index
(still mod_rewrite, but #! replaced with ajax)www.blahblah.com/index
(the page will load with AJAX like facebook, but #! will be hidden)Can anyone give me examples of each of the questions above?
Thanks alot!
Use built-in settings to hide apps on Android First, open Settings, tap Home screen, and scroll to Hide apps. Tap the apps you want to hide, and they'll move to the Hidden apps section.
Anything after the hash (#
) isn't sent to the server, so you cannot read it server-side. You can, however, redirect the user using JavaScript. The information you're looking for will be stored in the variable window.location.hash
.
On page load, you can do something like the following:
hashString = window.location.hash.substring(8);
window.location = 'http://www.blahblah.com/'+hashString;
We're using substring
to remove the first eight characters (#!?page=
), so we'll be left with index
.
Module rewrite only changes what the server sees. Module rewrite can't, change what the local browser sees, which is where the js is being run.
The way Facebook load, is through requesting the contents of the new page, then it updates the window URL instead of having to re-load everything. This is done, so If an item needs to be shared or linked the link is all up to date with what they're actually viewing, so when the page gets a fresh re-load, the browser loads the actual full php page, requested from the server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With