March 25th, 2012, 03:15 PM
Modifying .htaccess file problem...
I am using xampp.... I am trying to modify my .htaccess file so it is capable of executing php scripts even if the file extension is .htm or .html...
I added the following code to my .htaccess file, which is suppose to work...
AddType application/x-httpd-php .html .htm
however, nothing happened and my question is the .htaccess file located in the root of my testing server (xampp) is that the only htaccess file I need to modify? when I search for .htaccess I have about 8 different ones which are located in different folders of the site I am working on, do I need to modify those as well??
Any suggestions on making this work I will greatly appreciate!
Thanks in advance!
March 25th, 2012, 04:15 PM
(Moved from PHP Development to Apache Development.)
Are you certain that you reloaded the configuration after making these changes? There should be an option to reread the configuration files from within the main menu of XAMPP. If not, restarting the Apache server should also work.
March 25th, 2012, 09:50 PM
Xampp htaccess question
[[ merged in from another thread --requinix ]]
I have been trying to figure this out for a long time now, can someone please help me understand what htaccess file I would need to modify if I wanted to make changes to it, would it be the one located here... "C:\xampp\htdocs\forbidden\.htaccess", also if I have additional .htaccess files in the directories of the websites I am designing do I need to apply the changes to all htaccess files or only the one in the in the 'forbidden' directory?
Once I add code to the .htaccess file, is it necessary to restart the apache server? ... I read somewhere that restarting the server isn't necessary for changes to take effect, however, the changes I am trying to make aren't taking effect whether I am restarting the apache server (xampp) or not...
The changes I am trying to make the .htaccess file is to add "AddType application/x-httpd-php .html" in order to be able to execute php commands in a html document, with an html file extension....
thanks in advance for any help on resolving this.
Last edited by requinix; March 26th, 2012 at 04:50 PM.
March 26th, 2012, 09:48 PM
An .htaccess file will affect the directory it is in and any sub-directories below that point. It will not modify any parent or sibling directories.
Normally you do not need to restart Apache for .htaccess changes to take effect.
The most common reason for a .htaccess file not working is having AllowOverride set to None in your main Apache configuration file or vhost configuration directive. Setting AllowOverride to All will allow your .htaccess files to be processed. You will have to restart Apache after changing a directive in the main configuration file before .htaccess files will be processed.