diff --git a/docs/index.md b/docs/index.md
index 95d2649a2fd7eb71919629a4cd89bd660d5cadf5..d1275a45b649804c51292a1a791fd175c75d64e7 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -31,7 +31,7 @@ SimpleSAMLphp Documentation
   * [Configuring HTTP-Artifact](./simplesamlphp-artifact-idp)
   * [Identity Provider Advanced Topics](simplesamlphp-idp-more)
   * [Holder-of-Key profile](simplesamlphp-hok-idp)
- * [Automated Metadata Management](https://github.com/simplesamlphp/simplesamlphp-module-metarefresh/blob/master/docs/simplesamlphp-automated_metadata.md)
+ * [Automated Metadata Management](metarefresh:simplesamlphp-automated_metadata)
  * [Maintenance and configuration](simplesamlphp-maintenance) - covers session handling, php configuration etc.
  * [Authentication Processing Filters](simplesamlphp-authproc) - attribute filtering, attribute mapping, consent, group generation etc.
  * [Advanced features](simplesamlphp-advancedfeatures) - covers bridging protocols, attribute filtering, etc.
@@ -49,7 +49,7 @@ Documentation on specific SimpleSAMLphp modules:
  * [Consent module](./consent:consent)
  * [Installing and configuring the consentAdmin module](./consentAdmin:consentAdmin)
  * [Authorization](./authorize:authorize)
- * [autotest Module](./autotest:test)
+ * [autotest Module](https://github.com/simplesamlphp/simplesamlphp-module-autotest/blob/v1.0/README.md)
  * [Statistics](./statistics:statistics)
 
 Documentation for SimpleSAMLphp developers:
diff --git a/docs/simplesamlphp-advancedfeatures.md b/docs/simplesamlphp-advancedfeatures.md
index 69ddf67c4c87e581eab6935cf4c81609727e674c..58c1ee0ad97d880366db0fbe341ddb5b50a038ef 100644
--- a/docs/simplesamlphp-advancedfeatures.md
+++ b/docs/simplesamlphp-advancedfeatures.md
@@ -60,7 +60,7 @@ Automatic update of SAML 2.0 Metadata XML from HTTPS
 ----------------------------------------------------
 
 The `metarefresh` module is the preferred method for doing this.
-Please see the [metarefresh documentation](https://github.com/simplesamlphp/simplesamlphp-module-metarefresh/blob/master/docs/simplesamlphp-automated_metadata.md).
+Please see the [metarefresh documentation](metarefresh:simplesamlphp-automated_metadata).
 
 
 
diff --git a/docs/simplesamlphp-customauth.md b/docs/simplesamlphp-customauth.md
index 679c6586620b8dbe70fb05e9ed43904315b27024..9dd09db46ff2aee7b336eaedf1751d295281eb8a 100644
--- a/docs/simplesamlphp-customauth.md
+++ b/docs/simplesamlphp-customauth.md
@@ -1,7 +1,7 @@
 Implementing custom username/password authentication
 ====================================================
 
-This is a step-by-step guide for creating a custom username/password [authentication source](./simplesamlphp-authsource.md) for SimpleSAMLphp.
+This is a step-by-step guide for creating a custom username/password [authentication source](./simplesamlphp-authsource) for SimpleSAMLphp.
 An authentication source is responsible for authenticating the user, typically by getting a username and password, and looking it up in some sort of database.
 
 <!-- {{TOC}} -->
@@ -9,7 +9,7 @@ An authentication source is responsible for authenticating the user, typically b
 Create a custom module
 ----------------------
 
-All custom code for SimpleSAMLphp should be contained in a [module](./simplesamlphp-modules.md).
+All custom code for SimpleSAMLphp should be contained in a [module](./simplesamlphp-modules).
 This ensures that you can upgrade your SimpleSAMLphp installation without overwriting your own code.
 In this example, we will call the module `mymodule`.
 It will be located under `modules/mymodule`.
@@ -216,7 +216,7 @@ Note that we have updated the username & password to "theconfigusername" and "th
 A more complete example - custom database authentication
 --------------------------------------------------------
 
-The [sqlauth:SQL](../modules/sqlauth/docs/sql.md) authentication source can do simple authentication against SQL databases.
+The [sqlauth:SQL](sqlauth:sql) authentication source can do simple authentication against SQL databases.
 However, in some cases it cannot be used, for example because the database layout is too complex, or because the password validation routines cannot be implemented in SQL.
 What follows is an example of an authentication source that fetches an user from a database, and validates the password using a custom function.
 
diff --git a/docs/simplesamlphp-install.md b/docs/simplesamlphp-install.md
index 38c579dd46bc158ffdb2126dc87005d283a2928c..b5ba34ddbeef2e61c7f5583beeed808b67148626 100644
--- a/docs/simplesamlphp-install.md
+++ b/docs/simplesamlphp-install.md
@@ -20,7 +20,7 @@ This document is part of the SimpleSAMLphp documentation suite.
 
 This document covers the installation of the latest stable version of SimpleSAMLphp.
 If you want to install the development version, take a look at the instructions for [installing SimpleSAMLphp from the 
-repository](simplesamlphp-install-repo.md).
+repository](simplesamlphp-install-repo).
 
 
 Prerequisites
@@ -153,7 +153,7 @@ Note the `Alias` directive, which gives control to SimpleSAMLphp for all urls ma
 them are accessible through the `www` subdirectory of your SimpleSAMLphp installation. You can name the alias 
 whatever you want, but the name must be specified in the `baseurlpath` configuration option in the `config.php` file of 
 SimpleSAMLphp as described in
-[the section called “SimpleSAMLphp configuration: config.php”](#sect.config "SimpleSAMLphp configuration: config.php").
+[the section called “SimpleSAMLphp configuration: config.php”](#section_6 "SimpleSAMLphp configuration: config.php").
 Here is an example of how this configuration may look like in `config.php`:
 
 ```
@@ -174,7 +174,7 @@ directory too, use the `metadatadir` configuration option to specify the locatio
 
 This is just the basic configuration to get things working. For a checklist
 further completing your documentation, please see
-[Maintenance and configuration: Apache](simplesamlphp-maintenance.md#apache-configuration).
+[Maintenance and configuration: Apache](simplesamlphp-maintenance#section_5).
 
 
 Configuring Nginx
@@ -234,7 +234,7 @@ There are a few steps that you should complete in the main configuration file, `
 -  Set an administrator password. This is needed to access some of the pages in your SimpleSAMLphp installation web
    interface.
    
-   Hashed passwords can also be used here. See the [`authcrypt`](../modules/authcrypt/docs/authcrypt.md) documentation
+   Hashed passwords can also be used here. See the [`authcrypt`](authcrypt:authcrypt) documentation
    for more information.
 
    ```
@@ -366,16 +366,16 @@ Provider (in order to protect access to an existing application) or an Identity
 a user database where your users can authenticate). Documentation on bridging between federation protocols is found 
 in a separate document.
 
- - [Using SimpleSAMLphp as a Service Provider (SP)](simplesamlphp-sp.md)
-   + [Remote IdP reference](simplesamlphp-reference-idp-remote.md)
+ - [Using SimpleSAMLphp as a Service Provider (SP)](simplesamlphp-sp)
+   + [Remote IdP reference](simplesamlphp-reference-idp-remote)
    + [Connecting to the UK Access Federation or InCommon](simplesamlphp-ukaccess)
- - [Using SimpleSAMLphp as an Identity Provider (IdP)](simplesamlphp-idp.md)
-   + [Hosted IdP reference](simplesamlphp-reference-idp-hosted.md)
-   + [Remote SP reference](simplesamlphp-reference-sp-remote.md)
-   + [Setting up an IdP for G Suite (Google Apps)](simplesamlphp-googleapps.md)
-   + [Advanced Topics](simplesamlphp-idp-more.md)
- - [Automated Metadata Management](https://github.com/simplesamlphp/simplesamlphp-module-metarefresh/blob/master/docs/simplesamlphp-automated_metadata.md)
- - [Maintenance and configuration](simplesamlphp-maintenance.md)
+ - [Using SimpleSAMLphp as an Identity Provider (IdP)](simplesamlphp-idp)
+   + [Hosted IdP reference](simplesamlphp-reference-idp-hosted)
+   + [Remote SP reference](simplesamlphp-reference-sp-remote)
+   + [Setting up an IdP for G Suite (Google Apps)](simplesamlphp-googleapps)
+   + [Advanced Topics](simplesamlphp-idp-more)
+ - [Automated Metadata Management](metarefresh:simplesamlphp-automated_metadata)
+ - [Maintenance and configuration](simplesamlphp-maintenance)
 
 
 Support
@@ -406,7 +406,7 @@ The SimpleSAMLphp package contains one folder named `simplesamlphp-x.y.z` (where
 this folder there are a lot of subfolders for library, metadata, configuration, etc. One of these folders is named 
 `www`. **Only this folder should be exposed on the web**. The recommended configuration is to put the whole 
 `simplesamlphp` folder outside the web root, and then link to the `www` folder by using the `Alias` directive, as 
-described in [the section called “Configuring Apache”](#sect.apacheconfig "Configuring Apache"). This is not the only
+described in [the section called “Configuring Apache”](#section_4 "Configuring Apache"). This is not the only
 possible way, though.
 
 As an example, let's see how you can install SimpleSAMLphp in your home directory on a shared hosting server.
diff --git a/docs/simplesamlphp-sp.md b/docs/simplesamlphp-sp.md
index 365289f49eae4104c30cb06cd23d44df496d194a..045e19a568d70000f636111e1ad87afc873315aa 100644
--- a/docs/simplesamlphp-sp.md
+++ b/docs/simplesamlphp-sp.md
@@ -122,7 +122,7 @@ directory.
 If you intend to add your SP to a federation, the procedure for managing trust in federations differ, but the common part is
 that you would need to provide the *SAML 2.0 metadata of your SP*, and register that with the federation administration.
 You will probably be required too to consume the federation metadata periodically. Read more about
-[automated metadata management](https://github.com/simplesamlphp/simplesamlphp-module-metarefresh/blob/master/docs/simplesamlphp-automated_metadata.md) to learn more about that. 
+[automated metadata management](metarefresh:simplesamlphp-automated_metadata) to learn more about that. 
 
 
 Test the SP