Jump to content


Photo

Opening pages in domains


  • Please log in to reply
6 replies to this topic

#1 amalosoul

amalosoul
  • Members
  • PipPipPip
  • Advanced Member
  • 95 posts

Posted 23 August 2006 - 10:40 AM

I have one domain for example www.mydomain.host.com. When someone opens in his/her browser this link it displays the content of htdocs (I am using Apache in order to run PHP). How can I prevent the browser from showing the content of the folder and instead to redirect towards a php page?

#2 448191

448191
  • Staff Alumni
  • Advanced Member
  • 3,545 posts
  • LocationNetherlands

Posted 23 August 2006 - 12:20 PM

This is more of an Apache question.

Apache has a directive 'DirectoryIndex', wich determins wich file it accesses when a directory, not a file is requested. If none of the files specified in this directive are present, but the directory is accessible to the client, it renders a standard page, listing files and directories in that directory.

If you're using a file called 'index.php', it should be in this directive.

For example:
DirectoryIndex index.php index.html

Chances are however, your 'host.com' doesn't support php, as these free hosts usually don't.

If it does, and doesn't have index.php in the DirectoryIndex directive in httpd.conf, then you can redirect from an index.html.

You could use :
<meta http-equiv="refresh" content="0; URL=index.php" />


#3 amalosoul

amalosoul
  • Members
  • PipPipPip
  • Advanced Member
  • 95 posts

Posted 23 August 2006 - 12:59 PM

Thank you very much!

#4 448191

448191
  • Staff Alumni
  • Advanced Member
  • 3,545 posts
  • LocationNetherlands

Posted 23 August 2006 - 01:02 PM

Got kudos? ;D Marking your thread [solved] will do too.. ;)

#5 amalosoul

amalosoul
  • Members
  • PipPipPip
  • Advanced Member
  • 95 posts

Posted 15 September 2006 - 02:37 PM

No I don't have kudos...but the other reply solved my problem. So I thank you both:)!

#6 448191

448191
  • Staff Alumni
  • Advanced Member
  • 3,545 posts
  • LocationNetherlands

Posted 15 September 2006 - 04:05 PM

No I don't have kudos...but the other reply solved my problem. So I thank you both:)!


Darn, no kudo's? The both of me were so much looking forward to those.  :P



#7 amalosoul

amalosoul
  • Members
  • PipPipPip
  • Advanced Member
  • 95 posts

Posted 15 September 2006 - 04:29 PM

Sorry, my mistake I didn't notice that the replies came from the same person:).
So I thank the only one of you  ;D!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users