rejetto forum

How to make a folder as homepage?

0 Members and 1 Guest are viewing this topic.

Offline Leo.D.fantast

  • Occasional poster
  • *
    • Posts: 7
    • View Profile
What I want is:

When someone type my IP address in browser, the folder added to HFS is opened as the homepage.

But now I can only open the default hompage
http://192.168.26.1/
then open the folder
http://192.168.26.1/folder

Can I just type http://192.168.26.1/ and open that folder?


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13524
    • View Profile
in the main folder set a default file mask index.html
then create and put a file with that name containing
Code: [Select]
<html><head><meta http-equiv=refresh content="0; /folder1"></head></html>
where folder1 is the name of your folder


Offline Leo.D.fantast

  • Occasional poster
  • *
    • Posts: 7
    • View Profile
You mean this?



Put the index.html in the virtual main folder as the picture show? or in the folder where HFS installed?

And my index.html file contain the following:

Code: [Select]
<html><head><meta http-equiv=refresh content="0; /folder"></head></html>
But when I type only the IP address, I can't open the page.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13524
    • View Profile
hmm, yes, it is all right
well, it seems to work with firefox and opera
IE seems to have problems
i don't know why
does anyone know how to make this solution compatible with IE ?


Offline Leo.D.fantast

  • Occasional poster
  • *
    • Posts: 7
    • View Profile
Yes, I've tried it in FireFox, it really works.

But most people use IE. Hope there's a solution.


Anonymous

  • Guest
Quote from: "Leo.D.fantast"
But most people use IE.
Most security minded people use Opera and maybe Firefox.  IE is used mainly by newbies who don't know better.


Offline MarkV

  • Tireless poster
  • ****
    • Posts: 764
    • View Profile
Hm I use the following index.html

Code: [Select]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<script language="JavaScript1.1" type="text/javascript">
<!--
location.replace("/folder");
//-->
</script>
<noscript>
<meta http-equiv="Refresh" content="0; URL=/folder">
</noscript>
</head>
<body>
If your browser does not support redirect <A href="/folder">click here</a>
</body>
</html>

There are 3 options:

1. Javascript
2. The 'normal' way http-equiv="Refresh" (if JS is disabled)
3. If 1 and 2 fail the text
Quote from: "Browser"
If your browser does not support redirect click here.
is displayed so you can advance manually.

Tested with IE and works with and without JS. Hope that helps. :)

MarkV
http://worldipv6launch.org - The world is different now.


Offline Leo.D.fantast

  • Occasional poster
  • *
    • Posts: 7
    • View Profile

Offline Leo.D.fantast

  • Occasional poster
  • *
    • Posts: 7
    • View Profile
I have some trouble with the new version. Almost all times when someone visits my page, the page can't open. He must refresh the page for many times, then got the following page:

301 - Moved permanently to /MyFolder/

click the link '/MyFolder/', finally got the right one.

Perhaps the code that MarkV posted can't redirect to the folder in new version.

Now I can only use back to version 2.0.

Please help me, dear MarkV.


Offline MarkV

  • Tireless poster
  • ****
    • Posts: 764
    • View Profile
Are you using the latest version?

There are already several (older) posts about this problem. It seems to be IE related, lets see...

here, here, and here.

You should post in the Bug Reports forum if your problem persists even with the latest version (2.1a build #55 at time of writing). But it has nothing to do with the redirection code I think (well it's not even MY code, somebody posted it earlier already).

MarkV
http://worldipv6launch.org - The world is different now.


Offline Leo.D.fantast

  • Occasional poster
  • *
    • Posts: 7
    • View Profile

Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13524
    • View Profile
i think i know the solution:
just replace /folder with /folder/