i can access php files without typeing extensions

Discussion in 'Technical' started by Helstedxd, Sep 7, 2011.

  1. Helstedxd

    Helstedxd New Member

    Hi HowToForge

    I have set a Debian minimal 6 LAMP server up, and i have enabled mod_rewrite, but when i make a .htaccess file and write index.html i get a Error 404, but i can access the index.php without typeing the php extension, like http://domain/index

    my .htaccess

    Code:
    RewriteEngine on
    RewriteRule (.*)\.html $1.php
    i hope some of you can help me with my problem

    //Kasper Helsted
     
  2. robsbots

    robsbots New Member

    Google say's.....

    Hi Helstedxd

    I did a quick google on the problem and it spat this out :-

    Code:
    RewriteEngine on
    RewriteRule index\.html index.php [NC,R]
    
    NC means it is not case sensitive: index=INDEX=InDeX and R is the redirect.

    Give it a try and see if it does what you require.

    My source was here about a third of the way down the page.
     
  3. manojsamtani

    manojsamtani New Member

    You can use apache mime/content-negotiation...its easy to use :)


    --
    Manoj
    apache-dos-attack.blogspot.com
     

Share This Page