rnmcd Posted December 13, 2005 Posted December 13, 2005 I'm not sure which forum this question belongs...sorry. Is there a way to 'force' everyone that visits your site to go to a specified page (such as the index page) even if they have a different page bookmarked? Quote
GroovyFish Posted December 13, 2005 Posted December 13, 2005 I have used this before: <script language="JavaScript">if (parent.location.href == self.location.href){ window.location.href = 'index.html' } </script> Just place it in the head section of your html document. Quote
rnmcd Posted December 13, 2005 Author Posted December 13, 2005 "Wow" and thank you! I was incorrectly assuming that it would be much more involved. Quote
GroovyFish Posted December 13, 2005 Posted December 13, 2005 You're welcome! Of course, it's only going to work for people that have Javascript enabled in their browser. I don't know if there is another way to do it that will get everyone, Javascript enabled or not. Quote
JTD Posted December 14, 2005 Posted December 14, 2005 You can also use something like this. And you can set this part content="1 from 1 to 5. That just determines how fast it redirects them. ><meta http-equiv="Refresh" content="1;url=http://Link to the url you want them to go to here"> Quote
rnmcd Posted December 14, 2005 Author Posted December 14, 2005 JTD, that code isn't javascript-enabled browser dependent, right? Quote
JTD Posted December 15, 2005 Posted December 15, 2005 (edited) JTD, that code isn't javascript-enabled browser dependent, right? No it isnt. Visit this link and you will see how it works. http://www.phantom309drivers.org/guestbook/ Edited December 15, 2005 by JTD Quote
rnmcd Posted December 15, 2005 Author Posted December 15, 2005 No it isnt. Visit this link and you will see how it works. http://www.phantom309drivers.org/guestbook/ Nice. Out of curiousity, why doesn't it do the redirect when I initially visit: http://www.phantom309drivers.org/games/ Quote
JTD Posted December 16, 2005 Posted December 16, 2005 Nice. Out of curiousity, why doesn't it do the redirect when I initially visit: http://www.phantom309drivers.org/games/ Because I have no redirect setup for that games link. The only link with a redirect is this one. And only because I may have missed changing a few links to various places I visit. I used to have all my sites seperate now they are all phpnuke. http://www.phantom309drivers.org/guestbook/ Quote
rnmcd Posted December 16, 2005 Author Posted December 16, 2005 Because I have no redirect setup for that games link. The only link with a redirect is this one. And only because I may have missed changing a few links to various places I visit. I used to have all my sites seperate now they are all phpnuke. http://www.phantom309drivers.org/guestbook/ Would there be a way to get each and every person that visits any page on phantom309drivers.org to have to visit another page on your site first? What I would like to ultimately do is make everyone that goes to any page on my site be required to view a "site info" page that tells of important site changes. It would be great if I could set a cookie or something that doesn't take/redirect them through this "site info" page more than once every 24 hours. Upon looking at your redirect I notice that it is different than what I am trying to achieve. I want, for example, users that click on a page like your http://phantom309drivers.org/modules.php?name=Guestbook to be automatically redirected through http://www.phantom309drivers.org/guestbook/ first. This is probably much more complicated than I anticipated. Quote
coleary Posted December 21, 2005 Posted December 21, 2005 Another way to direct is through PHP. You can do it very simply by using the following code... ><? header("Location: http://www.whatever.com"); ?> Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.