Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.htaccess - Is Content-Language same as DefaultLanguage?

In .htaccess what is the difference between doing

Header set Content-Language en

and

DefaultLanguage en
like image 484
RafaSashi Avatar asked Aug 14 '26 22:08

RafaSashi


1 Answers

DefaultLanguage is intended for set the default language when a directory contains multiple language files, e.g.: index.html.en, index.html.fr. They need to be set with AddLanguage in Apache configuration somewhere:

AddLanguage en .en
AddLanguage fr .fr

Files will these extensions will be delivered with the Content-Language HTTP header. If no extension is provided, can be a coincidence to have both methods generating the Content-Language header but if you want to explicitly set the document Content-Language may run slightly faster with explicit header definition, as it does not need to check the file extension and fallback to a default language if set.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!