Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6361357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:46:02+00:00 2026-05-24T23:46:02+00:00

i asked a question if i can execute html files as php files and

  • 0

i asked a question if i can execute html files as php files and i got those answers

AddType application/x-httpd-php5 .php .html

and another answer

AddHandler application/x-httpd-php .html .htm 

and here is another one

RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html

and i got 1 problem
when i used to write any condition to add type it send me to download the page instead of run it
for example if i have a file index.html which have php code
after i create the .htaccess and write

RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html

then try to navigate the link it send me to download index.html instead of run it

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T23:46:03+00:00Added an answer on May 24, 2026 at 11:46 pm

    AddType is used to assign a MIME type to a file suffix.

    F.e. to override the MIME type of an PDF *sic

    AddType text/plain .pdf
    

    This will force the browser to load and show a PDF as plain text, because server is sending the text/plain MIMe type. But many applications handle files by content and not by suffix.

    RemoveHandler
    

    This is unnecessary, you don’t want to remove anything from the standard configuration.

    AddHandler handler-name .htm
    

    This should do it, but it depends on your server configuration. You need the right “handler-name”.

    Standard handler-name for most Apache servers with PHP installed is

    AddHandler application/x-httpd-php .html
    AddHandler application/x-httpd-php .htm
    

    but it could differ and it depends on your configuration. If you are using a shared or managed hosting without access to the Apache configuration file, you should ask your hoster.

    I was using shared hosting with handler-names like

    AddHandler php4-cgi .php .html
    
    or
    
    AddHandler php52-cgi .php .html
    
    and another was using totally different way like
    
    AddType x-mapp-php5 .php .php5 .htm .html
    

    Otherwise have a look on your Apache configuration file. This page may be helpful to find the right section and to adapt.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This was the question asked in interview. Can we call one constructor from another
I asked a question about different testing frameworks yesterday. This question can be found
I asked a question earlier about why left joins in Linq can't use defined
I've recently asked a question on StackoverFlow about the MVC: Can the MVC Design
This question seems to be asked freqeuently over the internet but I still can't
It's quite possible a question like this has been asked before, but I can't
This is a follow-on question from the one I asked here . Can constraints
I've asked another related question to this here: casting dynamic to static problem I've
I've seen the question asked can you run Monit on Windows?, and unless you
I have asked this question in a different post here on SO: How can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.