dcumpian Posted October 8, 2004 Posted October 8, 2004 I have a site that uses a frameset. Whenever a visitor goes to the site without specifying a page, or if specifying /index.htm, everything's fine. But some people insist on using /Home.htm and then the home page loads without the frameset. Is there any HTML code that will force the Home.htm to load with the frameset if the frame isn't loaded? I suppose I could just rename Home.htm to something else Thanks, Dan Quote
TCH-Bruce Posted October 8, 2004 Posted October 8, 2004 Rename it something else and in your .htaccess file add a redirect for that filename to load your index page. There are also scripts that you can use to load the frame set if a direct request for a page outside the frame set. Check www.hotscripts.com, you should be able to find something. As an aside, frame pages are search engine unfriendly and not very popular anymore. Quote
dcumpian Posted October 8, 2004 Author Posted October 8, 2004 As an aside, frame pages are search engine unfriendly and not very popular anymore. I've been made aware of this...I suppose that's why the Home.htm page keeps coming up linked from the search engines as that's where the content is. I'm no web designer, so I'm reluctant to redo this website as it does have all of the content I needed to put out there. The frameset is nothing more than a navigation menu with a logo. Any suggestions on how to get rid of the frameset without having to redesign the whole site? Thanks, Dan Quote
TCH-Bruce Posted October 8, 2004 Posted October 8, 2004 (edited) Is the site in frames the link the WWW button takes you to? I would suggest using a PHP include for the navigation that would be inserted into each page automatically for you. See this this post for more information. Edited October 8, 2004 by TCH-Bruce Quote
TCH-Bruce Posted October 8, 2004 Posted October 8, 2004 (edited) And here is another tutorial that breaks it down even simpler. Edited October 8, 2004 by TCH-Bruce Quote
dcumpian Posted October 9, 2004 Author Posted October 9, 2004 Thanks Bruce, I'll read up on this... Dan Quote
oompahloompah Posted October 9, 2004 Posted October 9, 2004 The method I've used before is Javascript-based and basically it checks to see if the parent frame has been loaded when the page within the frame is called. This can be done by checking to see if home.htm is at the top via the following condition, if self == top, then we know that home.htm is not within the frames. Personally I prefer using the alternate method of checking via top.frames.length which checks to see the number of frames present at the moment. Then point top.location.href to the appropriate frame page that you want. My memory may have been rusty and this is just off the top of my head so let me know if it works. Hope this helps. Quote
oompahloompah Posted October 9, 2004 Posted October 9, 2004 I agree with Bruce that framed pages do cause problems with search engines. However a couple of years back when frames were the popular thing, I did up a site based on frames and had pretty good search engine placements on all the popular ones. It's always good to have an extra set of navigation, I agree and PHP sounds like a good and fast way of implementing it. All this is if you still can't get your frame protection in place, otherwise visitors should be able to still visit any of your pages via search engines and get automatically redirected to within a frame. Good luck with it. 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.