Page 1 of 2

PHP no extension

Posted: Wed Aug 09, 2006 11:53 pm
by ityd
How do I get a php script to not have an extension http://mysite.com/script
script is a php file

My in the FAQ on the server they say to use a .htaccess in the main directory and use the code

Code: Select all

<Files filename_to_be_parsed>
ForceType x-mapp-php4
</Files>
However I get a 404 error. Any suggestions?
Thanks.

Posted: Thu Aug 10, 2006 12:37 am
by RobertGonzalez
mod_rewrite and .htaccess. Read through the Useful Resources thread in the Apache, IIS and Servers forum.

Posted: Thu Aug 10, 2006 12:51 am
by Weirdan

Code: Select all

Options +MultiViews

Posted: Thu Aug 10, 2006 1:00 am
by ityd
i'll give it a try...

Posted: Thu Aug 10, 2006 1:02 am
by ityd
no still 404 error

Posted: Thu Aug 10, 2006 1:09 am
by RobertGonzalez
Hav you tried mod_rewrite?

Posted: Thu Aug 10, 2006 1:13 am
by ityd
No. You want to give me a crash course in mod_rewrite in a .htaccess?

Posted: Thu Aug 10, 2006 1:17 am
by RobertGonzalez
Search these boards for mod_rewrite. There have been a number of posts on it (many from me).

Posted: Thu Aug 10, 2006 1:44 am
by ityd
Well this doesnt work

Code: Select all

RewriteEngine On 
RewriteRule ^ status.php status

Posted: Thu Aug 10, 2006 1:50 am
by RobertGonzalez
OK, take what you have and check it against the mod_rewrte cheatsheets I referenced in m earlier post.

Posted: Thu Aug 10, 2006 1:52 am
by ityd
Sorry, I don't see your reference.

Posted: Thu Aug 10, 2006 1:53 am
by ityd
Oh I see

Posted: Thu Aug 10, 2006 2:00 am
by ityd
It seems there would be an easier way to fix this. I just want a website without any extensions.

Posted: Thu Aug 10, 2006 2:16 am
by Luke
how come?

Posted: Thu Aug 10, 2006 2:24 am
by ityd
Looks cooler.
Anyway I got it

Code: Select all

<Files status>
ForceType x-mapp-php4
</Files>
This is used to take a file with no extension and parse it as if it were a php file. So I just went and change status.php to status. But thanks for all your help.