x10Hosting Forums

Corporate Free Hosting for the Masses.



Register

Reply
 
LinkBack Thread Tools Display Modes
I love the internet

vigge_sWe's Avatar

Join Date: Oct 2007
Posts: 2,705
Credits: 8,762
vigge_sWe has a reputation beyond reputevigge_sWe has a reputation beyond repute
Location: Göteborg, Sweden

Quote  
05-12-2008, 04:57 PM
[TUTORIAL]Make the PHP Parser parse PHP inside a file with no extension

1.Put "DefaultType application/x-httpd-phpv2" in your .htaccess without quotes.

2. upload the file as no extension (in windows, you need to have the setting "Show filetypes" set to on. And then save the file like flash.txt and rename it to just flash)

Now yo may go to http://yourdomain.tld/flash instead of http://yourdomain.tld/flash.php

NOTE: Make sure you haven't got a folder with the same name!
__________________
Reply With Quote
vigge_sWe is offlineReport Post
Lord Of The Keys

LHVWB's Avatar

Join Date: Jan 2008
Posts: 1,280
Credits: 9,231
LHVWB is a jewel in the rough
Location: Australia

Send a message via MSN to LHVWB
Quote  
05-12-2008, 05:30 PM
Re: [TUTORIAL]Make the PHP Parser parse PHP inside a file with no extension

Nice tutorial, I might actually use this one.

I like that note about the folder, there is always an issue that you can create by mucking around with stuff!
Reply With Quote
LHVWB is offlineReport Post
x10Hosting Member

Join Date: Dec 2007
Posts: 13
Credits: 239
monkey_05_06 is on a distinguished road
Quote  
10-30-2008, 08:38 PM
Re: [TUTORIAL]Make the PHP Parser parse PHP inside a file with no extension

An alternate method to this which 1) allows multiple file types and 2) works if you're trying to access a directory would be to put this in .htaccess instead:

Code:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(([^/]+/+)*[^\.]+)$ $1.php? [QSA]
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(([^/]+/+)*[^\.]+)$ $1.html
For example if you type in "http://yoursite.x10hosting.com/somepage" this will first look for "somepage.php" then "somepage.html". If neither is found it will look for the directory named "somepage".

You can add other file-types by simply copying the RewriteCond and RewriteRule lines and changing the extension to the one you want to use.

P.S. The [QSA] (including brackets) tells the server to keep any arguments passed through the address bar, so pages such as "http://yoursite.x10hosting.com/somepage?someVar=27" will work properly. The arguments may be dropped off without it. It must be supplied for any extensions that will use address line arguments.

P.S.S. This works on regular files with the extension in the uploaded file. So leave the ".php" extension on your PHP files, just leave it out of the address. This is especially useful if the extensions you use in your site change, for example if you're upgrading to PHP from HTML but don't want to have to change all your links.

Last edited by monkey_05_06; 10-30-2008 at 09:37 PM.
Reply With Quote
monkey_05_06 is offlineReport Post
x10Hosting Member

Join Date: Oct 2008
Posts: 2
Credits: 208
Dg!Mortal is on a distinguished road
Quote  
11-13-2008, 02:20 AM
Re: [TUTORIAL]Make the PHP Parser parse PHP inside a file with no extension

nice & helpful, thanks
Reply With Quote
Dg!Mortal is offlineReport Post
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unstand PHP? o0slowpaul0o Tutorials 8 01-07-2008 10:16 PM
Sigo con problemas con phpbb2 reciecho Soporte 7 10-20-2007 07:28 PM
Max php file upload - how to adjust phixer Free Hosting 1 10-07-2007 10:15 PM
"PHP Startup: Invalid Library" - Interesting error javaguy78 Free Hosting 5 03-27-2007 03:33 PM


All times are GMT -5. The time now is 07:12 PM. Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0 RC7
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

Loans | Loans | American Flags | Model Trains | Xbox Mod Chip