Friday 16 September 2011

I'm using DNS services and I would like this website to start from a page of my choice rather than index.html?

Hi there,



I'm building a website using DNS services and I would like the site to start from a page of my choice rather than index.html



If I understood it correctly the index.html is always default somehow. I've pointed the DNS to the folder page and it automatically loads the index.html-file.



However, I would like the web page to start with another file called about.php.



I'm guessing that I should change the .htaccess file somehow... Or maybe there's another way of controlling which page is default for a site.



Please help me just a little bit.



Kind regards



ProooeyI'm using DNS services and I would like this website to start from a page of my choice rather than index.html?DNS only maps domain names with ip addresses and so cannot tell the web server which page to bring up first.



Your guess it correct. You need to add the following line to .htaccess

DirectoryIndex about.php

which makes the web server bring up about.php when no file is specified.



If you wanted the page to redirect to about.php (so http://mysite.com/ goes to http://mysite.com/about.php - it does not stay on http://mysite.com/) then you need to add an index.php file with the following line:

%26lt;?php header( 'Location: about.php' ) ; ?%26gt;