Forum Moderators: phranque
I finally got the XAMPP package working on my home PC (Win Xp pro). HURRAH!
Now I would like to add the following to the .htaccess file:
AddType application/x-httpd-php .htm .html
I'm stumped :(
The hosting I use has a handy control panel, which makes this stuff easy.
It could be that this is a simple thing to do. I just haven't found the way, yet.
Could someone please point me in the right direction.
I'm not looking to learn all about Apache servers, etc, I just want to use it, to test my pages with php includes and slowly learn more about php and mysql.
The above might be a stupid question, but I prefer to feel stupid for 5 minutes than stay stupid the rest of my life, ;)
The usual method is to use a plain-text editor such as Notepad to edit or create the file.
The directive:
[url=http://httpd.apache.org/docs/1.3/mod/mod_mime.html#addhandler]AddHandler[/url] server-parsed .html
Jim
When I get my offline server working correctly (LOL), I can then play around and learn a little more about how these things work :)
What I am doing is using php includes in html pages. I would like to see the pages, with includes, displayed in my browser, without physically changing the html pages to php pages.
As to the problem I have currently, there already exists a .htaccess file, in htdocs/forbidden/.
When I open it in notepad (or arachnophilia) it shows the following:
AuthType Basic
AuthName "FORBIDDEN AREA"
require valid-user
AuthUserfile "../htdocs/forbidden/.htpasswd"
Which I take to mean, this is not the way to approach this....:(
When I enter the page [localhost...] in my browser,
after supplying the user:password, I get the following:
Apache/2.0.54 (Win32) mod_ssl/2.0.54 OpenSSL/0.9.8 PHP/5.0.4 mod_autoindex_color Server at localhost Port 80
which I don't understand either :)
Reading your response, are you saying that just opening the .htacces file and adding the code desired and just 'plopping' it back where it was is sufficient?
That would be great!
Er, just to complicate things, there are two flys in the ointment:
1/ I have been reading about modifying the httpd.conf file which I have found in xampp/apache/conf (there I go, poking around again). Is this a better way forward?
2/ There seem to be two htaccess files :(, one in htdocs/forbidden, one in webdav/....
As you can see, I have been poking around, but am a little shy of messing around with things too much, just in case it goes feet up!
I am pleased for any light shown, on what appears to be a very dark pathway, so far, but very exciting, none the less ;)
So you need to create a new .htaccess file in the directories where you want html files parsed for PHP, or in any directory above those directories. The simplest case is to create a single .htaccess file in your 'Web root' directory -- the directory where your site's 'home page' resides. Any config set in that .htaccess file will then apply to the home page directory and to any subdirectory of your home page directory -- unless explicitly overridden by another .htaccess placed into one or more of those subdirectories.
Jim