1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2010
    Rep Power

    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!
  2. #2
  3. No Profile Picture
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2003
    Anaheim, CA (USA)
    Rep Power
    (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.
    ~~ Peter ~~ :: ( Who am I? ) :: ( Peter's Musings: Uploading myself, bit by bit... ) :: ( Electronic Frontier Foundation ) :: ( I'm a GNU/Linux addict and Free Software Advocate. ) :: ( How to Ask Questions the Smart Way ) :: ( The Fedora Project, sponsored by Red Hat ) :: ( GNOME: The Free Software Desktop Project ) :: ( GnuPG Public Key ) :: ( About me on the WIki )
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2012
    Rep Power

    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.
  6. #4
  7. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Rep Power
    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.

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

IMN logo majestic logo threadwatch logo seochat tools logo