## If your cran mirror is not in the root of your domain, e.g. yourdomain.com/CRAN/, ## then you would need to define two additional variables in your apache configuration. ## You can do it as follows ## Define CRAN_RewriteBase "/CRAN subpath on your domain/" ## Define CRAN_SystemPath "/filepath/" ## e.g. ## Define CRAN_RewriteBase "/CRAN/" ## Define CRAN_SystemPath "/var/www/CRAN/" ## !Note slashes on both sides. RewriteEngine On RewriteBase ${CRAN_RewriteBase} ## package=foo&version=bar if current RewriteCond "${CRAN_SystemPath}src/contrib/$1_$2.tar.gz" -f RewriteRule "^package=([^/]+)&version=([^/]+)$" "src/contrib/$1_$2.tar.gz" [R=seeother] ## package=foo&version=bar in archive RewriteCond "${CRAN_SystemPath}src/contrib/Archive/$1/$1_$2.tar.gz" -f RewriteRule "^package=([^/]+)&version=([^/]+)$" "src/contrib/Archive/$1/$1_$2.tar.gz" [R=seeother] RewriteBase "/" ## package=foo&version=bar if current RewriteCond "%{DOCUMENT_ROOT}/src/contrib/$1_$2.tar.gz" -f RewriteRule "^package=([^/]+)&version=([^/]+)$" "src/contrib/$1_$2.tar.gz" [R=seeother] ## package=foo&version=bar in archive RewriteCond "%{DOCUMENT_ROOT}/src/contrib/Archive/$1/$1_$2.tar.gz" -f RewriteRule "^package=([^/]+)&version=([^/]+)$" "src/contrib/Archive/$1/$1_$2.tar.gz" [R=seeother] RewriteRule ^package=([^/]+)/(.+) web/packages/$1/$2 [R=seeother] RewriteRule ^package=([^/]+) web/packages/$1/index.html [R=seeother] RewriteRule ^view=([^/]+) web/views/$1.html [R=seeother] #disabling includes if CRAN_HOST is not set # # # Options -Includes # #