Remove redirects. Do this in Nginx instead.

This commit is contained in:
Oliver Davies 2015-08-12 11:42:42 +01:00
parent d73e3902d4
commit 245860ed2c
2 changed files with 0 additions and 44 deletions

View file

@ -1,10 +0,0 @@
From,To
about,/
blog/2012/07/nomensa-accessible-media-player-drupal,/blog/install-nomensa-media-player-drupal/
cv,https://gist.github.com/opdavies/d096d553b80140a342d4
drupalgive,https://www.drupal.org/u/opdavies
projects,/services/
portfolio,/services/
speaking,/talks/
terms-and-conditions,/terms/
work,/services/
1 From To
2 about /
3 blog/2012/07/nomensa-accessible-media-player-drupal /blog/install-nomensa-media-player-drupal/
4 cv https://gist.github.com/opdavies/d096d553b80140a342d4
5 drupalgive https://www.drupal.org/u/opdavies
6 projects /services/
7 portfolio /services/
8 speaking /talks/
9 terms-and-conditions /terms/
10 work /services/

View file

@ -1,34 +0,0 @@
#!/usr/bin/env php
<?php
$csv = __DIR__ . '/redirects.csv';
$template = <<<EOS
---
layout: redirect
destination: %DESTINATION%
---
EOS;
$row = 0;
if (($handle = fopen($csv, 'r')) !== FALSE) {
while (($data = fgetcsv($handle, filesize($csv))) !== FALSE) {
$row++;
if ($row > 1) {
$templateData = [
'%DESTINATION%' => $data[1],
];
$output = strtr($template, $templateData);
$filename = str_replace('/', '-', $data[0]);
file_put_contents("source/$filename.html", $output);
echo "Written to $filename.html\n";
}
}
}
fclose($handle);