Jump to content

Opening pages in domains


amalosoul

Recommended Posts

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?
Link to comment
Share on other sites

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:
[code]DirectoryIndex index.php index.html[/code]

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 :
[code]<meta http-equiv="refresh" content="0; URL=index.php" />[/code]
Link to comment
Share on other sites

  • 4 weeks later...
[quote author=amalosoul link=topic=105310.msg434914#msg434914 date=1158331025]
No I don't have kudos...but the other reply solved my problem. So I thank you both:)!
[/quote]

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.