amalosoul Posted August 23, 2006 Share Posted August 23, 2006 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 https://forums.phpfreaks.com/topic/18398-opening-pages-in-domains/ Share on other sites More sharing options...
448191 Posted August 23, 2006 Share Posted August 23, 2006 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 https://forums.phpfreaks.com/topic/18398-opening-pages-in-domains/#findComment-79131 Share on other sites More sharing options...
amalosoul Posted August 23, 2006 Author Share Posted August 23, 2006 Thank you very much! Link to comment https://forums.phpfreaks.com/topic/18398-opening-pages-in-domains/#findComment-79152 Share on other sites More sharing options...
448191 Posted August 23, 2006 Share Posted August 23, 2006 Got kudos? ;D Marking your thread [solved] will do too.. ;) Link to comment https://forums.phpfreaks.com/topic/18398-opening-pages-in-domains/#findComment-79154 Share on other sites More sharing options...
amalosoul Posted September 15, 2006 Author Share Posted September 15, 2006 No I don't have kudos...but the other reply solved my problem. So I thank you both:)! Link to comment https://forums.phpfreaks.com/topic/18398-opening-pages-in-domains/#findComment-92432 Share on other sites More sharing options...
448191 Posted September 15, 2006 Share Posted September 15, 2006 [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 https://forums.phpfreaks.com/topic/18398-opening-pages-in-domains/#findComment-92482 Share on other sites More sharing options...
amalosoul Posted September 15, 2006 Author Share Posted September 15, 2006 Sorry, my mistake I didn't notice that the replies came from the same person:).So I thank the only one of you ;D! Link to comment https://forums.phpfreaks.com/topic/18398-opening-pages-in-domains/#findComment-92507 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.