We offer a seamless solution to make your ontology URIs resolvable and content negotiable by allowing URL redirection for your ontology URIs to our Agroportal URIs. To facilitate this process, we've provided you with a set of .htaccess rewrite rules. By following the simple instructions below, you'll be able to implement these rules swiftly and efficiently, ensuring smooth redirection

Instructions for Apache servers
  1. Access .htaccess File: Locate the .htaccess file in the root directory of your website, if it doesn't exist create one. This file controls how your web server behaves and is often used for URL rewriting and redirection.
  2. Copy and Paste Redirect Rules in the .htaccess file: Copy the rewrite rules provided in the black rectangle. Open the .htaccess file and paste the copied redirect rules into the file
  3. Enable rewrite module (Linux): you'll need to ensure that the Apache module called 'rewrite' is enabled by running the command `sudo a2enmod rewrite`
RewriteEngine On RewriteRule ^terms/BOHLMANN/?$ https://agroportal.lirmm.fr/ontologies/BOHLMANN [R=301,L] RewriteCond %{REQUEST_URI} ^.*terms/BOHLMANN/.*$ RewriteRule ^.*/([^/#]+)/?$ https://agroportal.lirmm.fr/ontologies/BOHLMANN/$1 [R=301,L]
RewriteEngine On
RewriteRule ^terms/BOHLMANN/?$ https://agroportal.lirmm.fr/ontologies/BOHLMANN [R=301,L]
RewriteCond %{REQUEST_URI} ^.*terms/BOHLMANN/.*$
RewriteRule ^.*/([^/#]+)/?$ https://agroportal.lirmm.fr/ontologies/BOHLMANN/$1 [R=301,L]

Instructions for Nginx servers
  1. Access Nginx configuration file: The location of this file can vary depending on your system, but common locations include /etc/nginx/nginx.conf, /etc/nginx/sites-available/default or /usr/local/etc/nginx/nginx.conf.
  2. Locate the server block or location block where you want to enable URL rewriting: This is typically within the server { ... } block.
  3. Copy and Paste Redirect Rules : Copy the rewrite rules provided in the black rectangle. Inside the appropriate block, add the copied rules to enable URL rewriting
  4. Test the configuration for syntax errors: Run the following command to test the redirection configuration `sudo nginx -t`
  5. Reload Nginx to apply the changes: Restart the nginx server to apply the redirection using this command `sudo systemctl reload nginx`
location / { rewrite ^/terms/BOHLMANN/?$ https://agroportal.lirmm.fr/ontologies/BOHLMANN permanent; if ($request_uri ~* terms/BOHLMANN/ ){ rewrite ^.*/([^/]+)/?$ https://agroportal.lirmm.fr/ontologies/BOHLMANN/$1 permanent; } }
location / {
    rewrite ^/terms/BOHLMANN/?$ https://agroportal.lirmm.fr/ontologies/BOHLMANN permanent;
    if ($request_uri ~* terms/BOHLMANN/ ){
        rewrite ^.*/([^/]+)/?$ https://agroportal.lirmm.fr/ontologies/BOHLMANN/$1 permanent;
    }
}
Note
This redirection works only for uri with the form of: url/path/resource_id This will not work for uris in the form of: url/path/to/something#resource_id OR url/path/to/something:resource_id