Welcome Guest. Please Login or Register  


You are here: Index > AMPPS > General Support > Topic : Force Apache to pick index.php over index.html



Threaded Mode | Print  

 Force Apache to pick index.php over index.html, how do I configure Apache to give preference/precedence to index.php instead of index.html (1 Replies, Read 10782 times)
phpenthu
Group: Member
Post Group: Newbie
Posts: 1
Status:
[Background] >> I am using Ampps stack for PHP development. In my public folder there are two index files. One is index.html and other is index.php. After running Apache server, when I type in URL - [localhost/<my-web-project>/public/][1], I get the content of [**index.html**], where as I want Apache to pick [index.php] located in the same folder. I don't want to specify everytime [localhost/<my-web-project>/public/index.php][4].

[Problem] >> So basically, how do I configure Apache to give preference/precedence to index.php instead of index.html. I know a similar @stackoverflow post - stackoverflow-DOT-COM/questions/16191861/giving-index-html-priority-over-index-php but the solution does not apply to me and I do not have enough reputation to comment there. So I am creating a new question.

[My .htaccess file, if that helps]>>

PHP Code

 <IfModule mod_rewrite.c>
        <
IfModule mod_negotiation.c>
            
Options -MultiViews
        
</IfModule>
    
        
RewriteEngine On
        
        
# Redirect Trailing Slashes If Not A Folder...
        
RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule 
^(.*)/$ /$[L,R=301]
        
        
# Handle Front Controller...
        
RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond 
%{REQUEST_FILENAME} !-f
        RewriteRule 
index.php [L]
        
        
# Handle Authorization Header
        
RewriteCond %{HTTP:Authorization} .
        
        
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    </
IfModule




IP: --   

Force Apache to pick index.php over index.html
jumla40_guy
Group: Member
Post Group: Newbie
Posts: 7
Status:
Have you tried:

DirectoryIndex index.php index.html // default is index.php

in your htaccess to force Apache to use a different default order -> yours
IP: --   

« Previous    Next »

Threaded Mode | Print  



Jump To :


Users viewing this topic
1 guests, 0 users.


All times are GMT. The time now is April 16, 2024, 4:49 pm.

  Powered By AEF 1.0.8 © 2007-2008 Electron Inc.Queries: 11  |  Page Created In:0.019