Opera Configuration Mime Types

To share Opera configuration files on your server, you need to specify a custom MimeType for each configuration type separately. There is more than one way to do this, hence the need for a small tutorial. I add instructions for the Apache Web Server.

Apache: FilesMatch?

With the help of .htaccess, you can specify MimeType for any extension. However, since all Opera configuration files share the .ini extension, the one-shoe-fits-all approach is inadequate. Therefore, one way out is to use global root .htaccess on a shared hosting solution to specify each MimeType separately for each configuration file.

  1. Put all configuration files in one folder, and name them accordingly: (keyboard.ini, menu.ini, mouse.ini, toolbar.ini, voice.ini).
  2. In .htaccess, enable ModRewrite?, and then add the FilesMatch? rules, as below:
RewriteEngine on
<FilesMatch "keyboard\.ini$">
	ForceType application/x-opera-configuration-keyboard
</FilesMatch>
<FilesMatch "mouse\.ini$">
	ForceType application/x-opera-configuration-mouse
</FilesMatch>
<FilesMatch "menu\.ini$">
	ForceType application/x-opera-configuration-menu
</FilesMatch>
<FilesMatch "toolbar\.ini$">
	ForceType application/x-opera-configuration-toolbar
</FilesMatch>
<FilesMatch "voice\.ini$">
	ForceType application/x-opera-configuration-voice
</FilesMatch>

If you already have RewriteEngine on line in your .htaccess, just plaster the FilesMatch? rules below that line.

Apache: AddType?

If you offer only one file for download, or if you prefer to use different .htaccess files for each directory, then you can use AddType?. Each .ini configuration file then must be in a separate directory, each with its own .htaccess, remember. Examples below.

Keyboard

Assuming that the keyboard configuration file resides in some /keyboard/ directory, we write at the top of .htaccess for that directory:

AddType 'application/x-opera-configuration-keyboard' ini

Menu

Assuming that the menu configuration file resides in some /menu/ directory, we write at the top of .htaccess for that directory:

AddType 'application/x-opera-configuration-menu' ini

Mouse

Assuming that the mouse configuration file resides in some /mouse/ directory, we write at the top of .htaccess for that directory:

AddType 'application/x-opera-configuration-mouse' ini

Toolbar

Assuming that the toolbar configuration file resides in some /toolbar/ directory, we write at the top of .htaccess for that directory:

AddType 'application/x-opera-configuration-toolbar' ini

Voice

Assuming that the voice configuration file resides in some /voice/ directory, we write at the top of .htaccess for that directory:

AddType 'application/x-opera-configuration-voice' ini

Obviously, with only one file, that is not a problem, and you can use AddType? in the root .htaccess.

Categories

CategoryOpera
CategoryTechnical
CategoryTutorial

Backlinks
There are 58 comments on this page. [Display and/or add comments]