RewriteEngine on
RewriteBase "/"
RewriteRule "^snakemake.php" "/index.php" [L]

# For publication
RewriteRule ^phylo https://mosga.mathematik.uni-marburg.de/job_9c2cb5d3_236.html [L,R=301]
RewriteRule ^genecomp https://mosga.mathematik.uni-marburg.de/job_195325c3_244.html [L,R=301]
RewriteRule ^organelles https://mosga.mathematik.uni-marburg.de/job_dd02ad62_247.html [L,R=301]

# Modes
RewriteRule ^comparative_genomics.html index.php?mode=comparative [L]
RewriteRule ^annotation.html index.php?mode=annotation [L]

RewriteRule ^api/([a-z]+)/v([0-9]+)/([a-zA-Z0-9_]+)/ api.php?method=$1&version=$2&action=$3 [L]
RewriteRule ^api/v([0-9]+)/([a-zA-Z0-9_]+)/ api.php?method=rest&version=$1&action=$2 [L]
RewriteRule ^api/([a-z]+)/([a-zA-Z0-9_]+)/ api.php?method=$1&version=999&action=$2 [L]
RewriteRule ^api/([a-zA-Z0-9_]+)/ api.php?method=rest&version=999&action=$1 [L]

RewriteRule ^job_([0-9]+)_([a-zA-Z0-9_]{8}).html index.php?status=1&uid=$2&id=$1 [L]
RewriteRule ^job_([a-zA-Z0-9_]{8})_([0-9]+).html index.php?status=1&uid=$1&id=$2 [L]
RewriteRule ^job_([a-zA-Z0-9_]{8})/(.*) uploads/$1/$2 [L]

RewriteRule ^logs_([a-zA-Z0-9_]{8})_([0-9]+).html index.php?logs=1&uid=$1&id=$2 [L]


<Files "jobs.db">
  Require all denied
</Files>

<Files "scheduler.php">
  Require all denied
</Files>

<Files "console">
  Require all denied
</Files>
