PDA

View Full Version : i can access php files without typeing extensions


Helstedxd
7th September 2011, 10:57
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

RewriteEngine on
RewriteRule (.*)\.html $1.php

i hope some of you can help me with my problem

//Kasper Helsted

robsbots
19th November 2011, 13:50
Hi Helstedxd

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


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 (http://www.namepros.com/web-design-discussion/259456-how-redirect-index-html-index-php.html) about a third of the way down the page.

manojsamtani
20th December 2011, 13:55
You can use apache mime/content-negotiation...its easy to use :)


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