diff --git a/.gitignore b/.gitignore index 473e4f8d..77bbbc4d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ /htdocs/* -!/htdocs/.htaccess /log /logs /node_modules diff --git a/htdocs/.htaccess b/htdocs/.htaccess deleted file mode 100644 index cbedd2c9..00000000 --- a/htdocs/.htaccess +++ /dev/null @@ -1,26 +0,0 @@ -AddType text/xml xml rss atom -AddType text/plain .md -AddType application/json .json -AddCharset utf-8 .html .css .js .rss .atom .xml .md .json .txt -ErrorDocument 404 /404.html -ErrorDocument 410 /404.html -DirectoryIndex index.html - -# General Blogophon redirects -RedirectMatch 301 ^/htdocs/(.*)$ /$1 -RedirectMatch 301 ^/posts/?$ / - -# Fixes for older versions -RedirectMatch 301 ^(/posts/.+?)\-/$ $1/ -RedirectMatch 301 ([^\/]+)\.md$ /posts/$1/ -Redirect Gone ^/posts/ich-und-du/ - -# Grav CMS redirects, including poor man's lowercasing -RedirectMatch 301 ^/page:(.*)$ / -RedirectMatch 301 ^/tag:A(.*)$ /tagged/a$1/ -RedirectMatch 301 ^/tag:F(.*)$ /tagged/f$1/ -RedirectMatch 301 ^/tag:G(.*)$ /tagged/g$1/ -RedirectMatch 301 ^/tag:L(.*)$ /tagged/l$1/ -RedirectMatch 301 ^/tag:N(.*)$ /tagged/n$1/ -RedirectMatch 301 ^/tag:R(.*)$ /tagged/r$1/ -RedirectMatch 301 ^/tag:(.*)$ / diff --git a/install.js b/install.js index 73a88a4b..f4dbbfe0 100755 --- a/install.js +++ b/install.js @@ -230,6 +230,9 @@ inquirer.prompt(questions).then( } shell.mkdir('-p', defaultValues.directories.data); + shell.mkdir('-p', defaultValues.directories.htdocs); + + shell.cp('./src/templates/.htaccess', defaultValues.directories.htdocs); //console.log(answers); ['/css', '/js'].forEach(function(link) { diff --git a/src/templates/.htaccess b/src/templates/.htaccess new file mode 100644 index 00000000..61212416 --- /dev/null +++ b/src/templates/.htaccess @@ -0,0 +1,13 @@ +AddType text/xml xml rss atom +AddType text/plain .md +AddType application/json .json +AddCharset utf-8 .html .css .js .rss .atom .xml .md .json .txt +ErrorDocument 404 /404.html +ErrorDocument 410 /404.html +DirectoryIndex index.html + +# General Blogophon redirects +RedirectMatch 301 ^/htdocs/(.*)$ /$1 +RedirectMatch 301 ^/posts/?$ / + +# Add your stuff here