jamescalvin Posted January 5, 2007 Share Posted January 5, 2007 Hey Freaks, Hopefully this is a simple fix. Right now, when someone goes to my site, they currently go to mysite.com/index.php but instead, I would like it to go to mysite.com/index.html but I have no clue how that's done. Can someone help me out with this one? I did a search, but I don't even know what that's called so I couldn't really find anything.Thanks Quote Link to comment https://forums.phpfreaks.com/topic/33028-change-index-file-order-i-want-my-site-to-read-my-html-file-first-then-php/ Share on other sites More sharing options...
kenrbnsn Posted January 5, 2007 Share Posted January 5, 2007 This is a function of the webserver, not PHP. Which web server are you using?Ken Quote Link to comment https://forums.phpfreaks.com/topic/33028-change-index-file-order-i-want-my-site-to-read-my-html-file-first-then-php/#findComment-153841 Share on other sites More sharing options...
ToonMariner Posted January 5, 2007 Share Posted January 5, 2007 its an apache setting - it looks for files in a certain order - normally index.html index.htm index.php but your server clearly has index.phpYou may be able to alter this in a .htaccess file (not sure what the flag u need is) other wise its asking your hosts to help out adn tell you haw to achive your goal.You could always remove your index.php file or rename it index2.php - if you have coded robustly this should be easy to achieve and updateable for the rest of the site. Quote Link to comment https://forums.phpfreaks.com/topic/33028-change-index-file-order-i-want-my-site-to-read-my-html-file-first-then-php/#findComment-153843 Share on other sites More sharing options...
jamescalvin Posted January 5, 2007 Author Share Posted January 5, 2007 Linux/Apache... is that what you mean? Quote Link to comment https://forums.phpfreaks.com/topic/33028-change-index-file-order-i-want-my-site-to-read-my-html-file-first-then-php/#findComment-153845 Share on other sites More sharing options...
Swords Posted January 5, 2007 Share Posted January 5, 2007 Make a .htaccess file in the directory you want it to affect and put this line in it:[code]DirectoryIndex index.html index.php[/code]This will have it direct to index.html first, and index.php if index.html isn't found. Note that it will affect all subdirectories of the directory you place it in. Quote Link to comment https://forums.phpfreaks.com/topic/33028-change-index-file-order-i-want-my-site-to-read-my-html-file-first-then-php/#findComment-153865 Share on other sites More sharing options...
jamescalvin Posted January 6, 2007 Author Share Posted January 6, 2007 If I already have a .htaccess file, can I just add that bit of code in there? Quote Link to comment https://forums.phpfreaks.com/topic/33028-change-index-file-order-i-want-my-site-to-read-my-html-file-first-then-php/#findComment-153882 Share on other sites More sharing options...
HoTDaWg Posted January 6, 2007 Share Posted January 6, 2007 [quote author=jamescalvin link=topic=121179.msg497818#msg497818 date=1168043279]If I already have a .htaccess file, can I just add that bit of code in there?[/quote]i would assume so. Quote Link to comment https://forums.phpfreaks.com/topic/33028-change-index-file-order-i-want-my-site-to-read-my-html-file-first-then-php/#findComment-153885 Share on other sites More sharing options...
EKINdesigns Posted January 6, 2007 Share Posted January 6, 2007 Yeah, just place it at the bottom Quote Link to comment https://forums.phpfreaks.com/topic/33028-change-index-file-order-i-want-my-site-to-read-my-html-file-first-then-php/#findComment-153887 Share on other sites More sharing options...
jamescalvin Posted January 6, 2007 Author Share Posted January 6, 2007 Works like a charm, you freaks are off the hook. Thanks a million... Quote Link to comment https://forums.phpfreaks.com/topic/33028-change-index-file-order-i-want-my-site-to-read-my-html-file-first-then-php/#findComment-153889 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.