gatsby-plugin-htaccess
Version:
gatsby-plugin-htaccess creates a customizable htaccess-file on build containing the most important default settings for performance and security.
12 lines (11 loc) • 406 B
JavaScript
const setRewriteBase = (content, RewriteBase) => {
if (!RewriteBase) return content
switch (typeof RewriteBase) {
case 'boolean':
return content.replace('### REWRITE-BASE ###', 'RewriteBase /')
case 'string':
return content.replace('### REWRITE-BASE ###', `RewriteBase ${RewriteBase}`)
default: return content
}
}
module.exports = setRewriteBase