Knowledge base

1000 FAQs, 500 tutorials and instructional videos. Here, there are only solutions!

Using mod_rewrite

This guide explains how to configure URL rewrites on your hosting. The Apache "mod_rewrite" module is enabled by default on all Infomaniak infrastructures.

 

Management via the .htaccess file

For security and stability reasons, Infomaniak does not allow direct modification of the server configuration (VirtualHost).

Any customization must be done via a .htaccess file placed at the root of your site.

In a .htaccess file, the regular expressions of your rewrite rules should not start with a slash (/).

  

Correct syntax

Example: you should use RewriteRule ^contact$ contact.php (instead of RewriteRule ^/contact$ contact.php)…

It is recommended to add the directive RewriteBase / right after enabling the engine (RewriteEngine On) to ensure the compatibility of your relative paths.


Has this FAQ been helpful?