PHP no extension

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

ityd
Forum Newbie
Posts: 17
Joined: Tue Aug 08, 2006 8:16 am

PHP no extension

Post 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.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

mod_rewrite and .htaccess. Read through the Useful Resources thread in the Apache, IIS and Servers forum.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

Code: Select all

Options +MultiViews
ityd
Forum Newbie
Posts: 17
Joined: Tue Aug 08, 2006 8:16 am

Post by ityd »

i'll give it a try...
ityd
Forum Newbie
Posts: 17
Joined: Tue Aug 08, 2006 8:16 am

Post by ityd »

no still 404 error
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Hav you tried mod_rewrite?
ityd
Forum Newbie
Posts: 17
Joined: Tue Aug 08, 2006 8:16 am

Post by ityd »

No. You want to give me a crash course in mod_rewrite in a .htaccess?
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Search these boards for mod_rewrite. There have been a number of posts on it (many from me).
ityd
Forum Newbie
Posts: 17
Joined: Tue Aug 08, 2006 8:16 am

Post by ityd »

Well this doesnt work

Code: Select all

RewriteEngine On 
RewriteRule ^ status.php status
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

OK, take what you have and check it against the mod_rewrte cheatsheets I referenced in m earlier post.
ityd
Forum Newbie
Posts: 17
Joined: Tue Aug 08, 2006 8:16 am

Post by ityd »

Sorry, I don't see your reference.
ityd
Forum Newbie
Posts: 17
Joined: Tue Aug 08, 2006 8:16 am

Post by ityd »

Oh I see
ityd
Forum Newbie
Posts: 17
Joined: Tue Aug 08, 2006 8:16 am

Post by ityd »

It seems there would be an easier way to fix this. I just want a website without any extensions.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

how come?
ityd
Forum Newbie
Posts: 17
Joined: Tue Aug 08, 2006 8:16 am

Post 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.
Post Reply