Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is "AddType" in .htaccess?

What is the difference those?

AddType x-mapp-php5 .php

AddType application/x-httpd-php .php

AddType x-httpd-php .php

?

The page loading speed significantly decreases when I have AddType application/x-httpd-php .php . Why would that be?

like image 959
webnat0 Avatar asked Apr 09 '10 01:04

webnat0


People also ask

What is Apache AddType?

The AddType directive maps the given filename extensions onto the specified content type. media-type is the media type to use for filenames containing extension .

What is AddEncoding directive?

The AddEncoding directive maps the given filename extensions to the specified encoding type. MIME-enc is the MIME encoding that is used for documents containing the extension. This mapping is added to any already in force, overriding any mappings that already exist for the same extension.

What is .htaccess file and why it is used?

. htaccess files (or "distributed configuration files") provide a way to make configuration changes on a per-directory basis. A file, containing one or more configuration directives, is placed in a particular document directory, and the directives apply to that directory, and all subdirectories thereof.

Where is .htaccess file in xampp?

htaccess file is usually present in your C:/xampp/htdocs/wordpress if you are in windows or /opt/lampp/htdocs/wordpress if you are on linux or mac if you can't find it simply... ( for Windows ) enable show hidden files in file manager...


1 Answers

It tells apache what mime-type to return when encountering that extension. See the docs here: http://httpd.apache.org/docs/2.0/mod/mod_mime.html#addtype

Mime-types are used for several things in Apache.

  1. to tell the browser how to treat the file
  2. to tell apache which handler to use

With AddHandler you can bind a handler (like PHP) to a specific mime-type. So using a different mime-type for PHP could result in a different parser being used.

like image 113
Wolph Avatar answered Oct 14 '22 07:10

Wolph