ok I installed a invisionfree mod on my forum that make http://omnimaga.dyndns.org or http://omnimaga.dyndns.org/index.php redirect to http://omnimaga.dyndns.org/index.php?act=site . however it doesnt seems to work fine. When I click the two first link it redirect to the board index instead, at least in Firefox, IE and Opera. It's a premade code
Code:
<script language="Javascript" type="text/javascript>
/*
Front Page as Portal v2.1
By Webworldx

*/
if(location.href.match(/\?\w+/) == null && document.referrer.match(location.pathname) == null){
if (location.href.match("index.php") == null && location.href.lastIndexOf("/") + 1 != location.href.length){
location.href += "/index.php?act=site"
} else {
location.href="index.php?act=site"
}
}
</script>
I am wondering how this code could be modified so when you type in address bar or click http://omnimaga.dyndns.org , http://omnimaga.dyndns.org/ , http://omnimaga.dyndns.org/index.php it redirect to http://omnimaga.dyndns.org/index.php?act=site , kinda like when you type http://www.unitedti.org which goes to the portal instead of the forums. I hope this is possible. Thanks in advance for your help
The first one works for me, the second one does not. Ponder, ponder...
Don't use JS, use PHP if your server supports it, then you won't have browser compatability conflicts...
Something needs to be changed with this line:


Code:
if(location.href.match(/\?\w+/) == null && document.referrer.match(location.pathname) == null){
the ./index.php one works for me, but not the ./ one....do you have anything else called index.something in that folder?

or you could make a file called index.html and have that redirect to ./index.php?module=site or whatever....
Yeah, that works fine for me too, only the plain domain is a problem.
i cant have php in my invisionfree board wrappers, only HTML and javascript. I guess this must be something related to not putting index.html but then I dunno how to fix it
KermMartian wrote:
Something needs to be changed with this line:


Code:
if(location.href.match(/\?\w+/) == null && document.referrer.match(location.pathname) == null){


This essentially says: "only process this script if there's no query string, eg no ?stuff after the url, AND you did not just come from another page on this server.
xlibman wrote:
i cant have php in my invisionfree board wrappers, only HTML and javascript. I guess this must be something related to not putting index.html but then I dunno how to fix it


i know, place a javascript re-direct script in "index.html" to "http://omnimaga.dyndns.org/index.php?act=site"
thats what I did I think. the board wrappers contain that script and are in index.html
http://omnimaga.dyndns.org/index.html == a 404 error, page not found

you don't have an index.html
Ok, that's definitely not the problem, that wouldn't do that.
I determined that this needs to be changed, just not positive how:

Code:
&& document.referrer.match(location.pathname) == null)
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement