Mobile app version of vmapp.org
Login or Join
Margaret670

: Change Apache +Indexes language I have a webpage with Index activated. I have this: Is there any way for change language of this, using .htaccess? I've already tried this Directives: AddLanguage

@Margaret670

Posted in: #Apache2 #Htaccess #Indexing

I have a webpage with Index activated.
I have this:


Is there any way for change language of this, using .htaccess?

I've already tried this Directives:

AddLanguage pt .pt
DefaultLanguage pt-PT
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP:Accept-Language} ^.*(pt).*$ [NC]
RewriteRule ^(.*)$ - [env=lang:%1]

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Margaret670

2 Comments

Sorted by latest first Latest Oldest Best

 

@Turnbaugh106

As you already guessed you can use jQuery to change the styling and other things like labels. However there is a better way and that is changing Apache's index template files. This can be done easily in the .htaccess file by using HeaderName and ReadmeName see below.

To use your own header and footer files you can use:

IndexOptions +SuppressHTMLPreamble
HeaderName /includes/header.html
ReadmeName /includes/footer.html


You could also opt to use a Directory Listing template that has been made by other people that will save you time:


H5ai
Apaxy
Indices
Mabishu Apache Autoindex
Repos Style


Alternatively you could check out this quality guide on making your own Directory Listing template in several easy steps.

10% popularity Vote Up Vote Down


 

@Welton855

Foud a way using jQuery .replace:

$(document).ready(function(){
$('body table tbody tr th a').each(function(i){ // THE OBJECT WHERE IS THE REPLACEING TEXT
$(this).html($(this).html().replace('Name','LOREN IPSUN'));
$(this).html($(this).html().replace('Last modified','LOREN IPSUN'));
$(this).html($(this).html().replace('Size','LOREN IPSUN'));
$(this).html($(this).html().replace('Description','LOREN IPSUN'));
});
});


Just change loren ipsun for whatever you want.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme