This class listens to the AFTER_RUN event in Sculpin 3 and locates pagination files (Page 2
and above) in order to generate a placeholder file that matches the legacy version
from Sculpin 2. There was a bug in Sculpin 2 that resulted in these files being named like
2.html
when the intent was actually to name them 2/index.html
for friendly URLs.
The output of the redirector is a very spartan HTML-based redirect. Should be sufficient for convincing search engines and the like to update their mappings.
This has been tested with Sculpin 3.0.0-ALPHA1.
Append the contents of sculpin_kernel.yml
to your existing sculpin_kernel.yml
.
Place LegacyRedirector.php
somewhere that the composer autoloader can find it. In my
case, I used a PSR-4 autoloader definition in my composer.json & ran composer update:
"autoload": {
"classmap": ["component-manager.php"],
"psr-4": {
"Beryllium\\Whateverthing\\": "app/src/"
}
}
Then I placed the file in the app/src/
folder.
Now, when generating your site, you should get both 2.html
(containing the HTML
redirect) and 2/index.html
, containing the actual Page 2 content.