ApacheTech
04-19-2012, 01:37 PM
Hi, first of all, I've been searching all night for a solution to this and haven't been able to find anything. Most [RESOLVED]s I've found have been about manipulating the anchors within the page etc.
I have a Joomla! site in a subdirectory from the root and in the root's index.php I have a full screen iframe displaying the Joomla! site. It all works perfectly and I've got quite far, just one last step to do.
Why would I do this you ask? Well, I've done it to enable a radio player on the site that works asynchronously to the site, so that it doesn't refresh on each page refresh.
This is the code snippet I'm using:
function locFix() {
//DEBUG alert("locFix function [FOUND]");
var iframe = document.getElementById("siteframe");
var relUri = iframe.contentWindow.location.pathname;
//DEBUG alert(relUri);
window.location.hash = relUri;
}
<body><iframe src="joomla/index.php" id="siteframe" frameborder="0" marginwidth="0" marginheight="0" width="100%" height="100%" onload="locFix();"></iframe></body>
This works brilliantly but I want it slightly better with something I'm sure you can do with mod_rewrite, I just haven't been able to find out how.
The script sets the url to http://www.domain.com/#/joomla/index.php but I'd like to rewrite that url to http://www.domain.com/index.php or even http://www.domain.com/joomla/index.php if that's not possible. Just so that it's Search Engine friendly and idiot proof (user proof! :p).
Facebook uses the same technique to handle embedded iframes' urls, but I haven't been able to find the rewrite rule at all.
Thank you for any hep you can give on this. I can give any more information needed, I hope it's clear what I'm trying to achieve.
I have a Joomla! site in a subdirectory from the root and in the root's index.php I have a full screen iframe displaying the Joomla! site. It all works perfectly and I've got quite far, just one last step to do.
Why would I do this you ask? Well, I've done it to enable a radio player on the site that works asynchronously to the site, so that it doesn't refresh on each page refresh.
This is the code snippet I'm using:
function locFix() {
//DEBUG alert("locFix function [FOUND]");
var iframe = document.getElementById("siteframe");
var relUri = iframe.contentWindow.location.pathname;
//DEBUG alert(relUri);
window.location.hash = relUri;
}
<body><iframe src="joomla/index.php" id="siteframe" frameborder="0" marginwidth="0" marginheight="0" width="100%" height="100%" onload="locFix();"></iframe></body>
This works brilliantly but I want it slightly better with something I'm sure you can do with mod_rewrite, I just haven't been able to find out how.
The script sets the url to http://www.domain.com/#/joomla/index.php but I'd like to rewrite that url to http://www.domain.com/index.php or even http://www.domain.com/joomla/index.php if that's not possible. Just so that it's Search Engine friendly and idiot proof (user proof! :p).
Facebook uses the same technique to handle embedded iframes' urls, but I haven't been able to find the rewrite rule at all.
Thank you for any hep you can give on this. I can give any more information needed, I hope it's clear what I'm trying to achieve.