Author |
Message |
Daniel
Team Member
![](images/rank_6.gif)
![](http://www.4webhelp.net/forums/images/daniel_avatar.php)
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Sun Sep 22, 2002 6:01 pm (21 years, 9 months ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
Ever wanted to keep your files ending in .html (that's the way they were before, or you want to have them like that because it "looks better" )?
If so, here's a little tip. It only works with Apache, but most servers use Apache anyway
Put the following text in a file called ".htaccess" in the root of your site:
Quote: | <Files *.html>
ForceType application/x-httpd-php
</Files> |
That's it!
Your .html files should now be parsed by PHP.
To do the same with any other files, just replace with Quote: | <Files *.whateveryouwant> |
|
________________________________
![Image Image](http://www.4webhelp.net/images/daniel_sig.gif) |
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by Daniel Find all posts by Daniel](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) |
![](images/spacer.gif) |
adam
Forum Moderator & Developer
![](images/rank_6.gif)
Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Tue Sep 24, 2002 6:20 pm (21 years, 9 months ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
you could do this with less code, simply:
Code: |
AddType application/x-httpd-php html inc cuo
|
This would make *.html, *.inc and *.cuo be parsed through PHP. |
________________________________ It's turtles all the way down... |
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by adam Find all posts by adam](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) ![Visit Poster's Website Visit Poster's Website](templates/4WebHelp2/images/lang_english/icon_www.gif) |
![](images/spacer.gif) |
Daniel
Team Member
![](images/rank_6.gif)
![](http://www.4webhelp.net/forums/images/daniel_avatar.php)
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Tue Sep 24, 2002 6:23 pm (21 years, 9 months ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
Yes, that's true. But my example can be more widely used, as you can use it for only one file:
Quote: | <Files blabla.html>
ForceType application/x-httpd-php
</Files> |
|
________________________________
![Image Image](http://www.4webhelp.net/images/daniel_sig.gif) |
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by Daniel Find all posts by Daniel](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) |
![](images/spacer.gif) |
adam
Forum Moderator & Developer
![](images/rank_6.gif)
Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Tue Sep 24, 2002 8:31 pm (21 years, 9 months ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
well, then it depends on your specific situation...
not sure why you'd need to use it on just one file though... |
________________________________ It's turtles all the way down... |
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by adam Find all posts by adam](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) ![Visit Poster's Website Visit Poster's Website](templates/4WebHelp2/images/lang_english/icon_www.gif) |
![](images/spacer.gif) |
Daniel
Team Member
![](images/rank_6.gif)
![](http://www.4webhelp.net/forums/images/daniel_avatar.php)
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Wed Sep 25, 2002 5:31 am (21 years, 9 months ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
Well that's what we're having to do at 4WebHelp, because we have some files which have no extension ![Smile](/forums/images/smilies/icon_smile.gif) |
________________________________
![Image Image](http://www.4webhelp.net/images/daniel_sig.gif) |
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by Daniel Find all posts by Daniel](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) |
![](images/spacer.gif) |
php4ever
Junior WebHelper
![Junior WebHelper Junior WebHelper](images/rank_1.gif)
![](images/avatars/gallery/artistic/LH_95.gif)
Joined: 10 Oct 2002
Posts: 49
|
Posted:
Fri Nov 08, 2002 6:31 am (21 years, 7 months ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
I took Daniel's suggestion and put the Force Files directive in my .htaccess file so that all the html files at my site can contain php which will be parsed. But, tonight I noticed that I have one subdirectory that really needs to be exempt from this directive. So, how do I remove the <FORCE FILES> directive for just one subdirectory? I tried 'RemoveType application/x-httpd-php .html' and that didn't work. Any suggestions? |
|
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by php4ever Find all posts by php4ever](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) |
![](images/spacer.gif) |
Daniel
Team Member
![](images/rank_6.gif)
![](http://www.4webhelp.net/forums/images/daniel_avatar.php)
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Fri Nov 08, 2002 4:32 pm (21 years, 7 months ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
Maybe Code: | AddType application/x-httpd-php php | would work? ![Question](/forums/images/smilies/icon_question.gif) |
________________________________
![Image Image](http://www.4webhelp.net/images/daniel_sig.gif) |
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by Daniel Find all posts by Daniel](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) |
![](images/spacer.gif) |
php4ever
Junior WebHelper
![Junior WebHelper Junior WebHelper](images/rank_1.gif)
![](images/avatars/gallery/artistic/LH_95.gif)
Joined: 10 Oct 2002
Posts: 49
|
Posted:
Sat Nov 09, 2002 6:11 am (21 years, 7 months ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
Thanks, Daniel, I tried what you wrote above but it didn't work. If you have any other thoughts, pls let me know.
--php4ever |
|
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by php4ever Find all posts by php4ever](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) |
![](images/spacer.gif) |
Daniel
Team Member
![](images/rank_6.gif)
![](http://www.4webhelp.net/forums/images/daniel_avatar.php)
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Sat Nov 09, 2002 7:44 am (21 years, 7 months ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
Not sure if this works, but try
It's worth a try ![Wink](/forums/images/smilies/icon_wink.gif) |
________________________________
![Image Image](http://www.4webhelp.net/images/daniel_sig.gif) |
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by Daniel Find all posts by Daniel](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) |
![](images/spacer.gif) |
php4ever
Junior WebHelper
![Junior WebHelper Junior WebHelper](images/rank_1.gif)
![](images/avatars/gallery/artistic/LH_95.gif)
Joined: 10 Oct 2002
Posts: 49
|
Posted:
Sat Nov 09, 2002 11:48 pm (21 years, 7 months ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
Daniel, tried your latest suggestion in re ForceType but that didn't work either.
Again, thanks for trying to help; I appreciate it. |
|
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by php4ever Find all posts by php4ever](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) |
![](images/spacer.gif) |
adam
Forum Moderator & Developer
![](images/rank_6.gif)
Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Sun Nov 10, 2002 1:49 pm (21 years, 7 months ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
if you used the force type thing for .html, try using just .htm for the files in that directory...I know it'll mean a lot of renaming and link changing...but it's all I can think of ![Very Happy](/forums/images/smilies/icon_biggrin.gif) |
________________________________ It's turtles all the way down... |
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by adam Find all posts by adam](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) ![Visit Poster's Website Visit Poster's Website](templates/4WebHelp2/images/lang_english/icon_www.gif) |
![](images/spacer.gif) |
php4ever
Junior WebHelper
![Junior WebHelper Junior WebHelper](images/rank_1.gif)
![](images/avatars/gallery/artistic/LH_95.gif)
Joined: 10 Oct 2002
Posts: 49
|
Posted:
Mon Nov 11, 2002 7:25 pm (21 years, 7 months ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
adam wrote: | if you used the force type thing for .html, try using just .htm for the files in that directory...I know it`ll mean a lot of renaming and link changing...but it`s all I can think of ![Very Happy](/forums/images/smilies/icon_biggrin.gif) | Adam,
Thanks for your suggestion. It does sound like a feasible solution -- and one that requires merely dropping one letter! However, as you note there is the tedium factor. There is also another way to resolve the problem that is also tedius -- replacing each '<?' in every file with <? Looks like the solution here will either way involve being less lazy than I'd like to be! ![Wink](/forums/images/smilies/icon_wink.gif) |
|
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by php4ever Find all posts by php4ever](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) |
![](images/spacer.gif) |
tarianz
Junior WebHelper
![Junior WebHelper Junior WebHelper](images/rank_1.gif)
![](images/avatars/gallery/artistic/LH_39.gif)
Joined: 10 Aug 2012
Posts: 1
|
Posted:
Fri Aug 10, 2012 5:01 pm (11 years, 10 months ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
Thats works correct for me ))
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
AddType application/x-bittorrent .torrent
bates methodглаукома |
|
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by tarianz Find all posts by tarianz](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) ![Visit Poster's Website Visit Poster's Website](templates/4WebHelp2/images/lang_english/icon_www.gif) |
![](images/spacer.gif) |
runescapevip
Junior WebHelper
![Junior WebHelper Junior WebHelper](images/rank_1.gif)
Joined: 16 Nov 2014
Posts: 3
|
Posted:
Sun Nov 16, 2014 7:58 am (9 years, 7 months ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
FIFA online involved new material administrator technique is fairly Aspect within this version, as football lovers player from the FIFA sequence, the identical because the EA representative features of football administrator is certainly no stranger to be able to Fifa Coins enrich and enhance the encounter ways casual sex. |
|
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by runescapevip Find all posts by runescapevip](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) |
![](images/spacer.gif) |
|