This is the website of Andy Carter a Textpattern and Drupal web developer living in the Steel city.
URL redirect plugin for Textpattern – love redirects, hate 404s.
If you’re in the process of restructuring a Textpattern site, then this is the plugin for you!
Requirements:-
Andy Carter. For other Textpattern plugins by me visit my Plugins page.
Thanks to Oliver Ker for giving me the idea for this plugin.
To install go to the ‘plugins’ tab under ‘admin’ and paste the plugin code into the ‘Install plugin’ box, ‘upload’ and then ‘install’. Finally activate the plugin.
To uninstall arc_redirect simply delete the plugin from the ‘Plugins’ tab. This will remove the plugin code and drop the arc_redirect table from your Textpattern database.
arc_redirect adds a new tab under ‘Extensions’ from where you can define pairs of URLs for handling redirects. Basically provide an original URL on your Textpattern site that is generating a 404, “page not found”, error and a redirect URL. Then whenever someone goes to the original URL rather than get the standard 404 error page they will be redircted to the new URL (with a 301 permenantely moved).
The original URL must produce a 404 page in Textpattern on the site this plugin is installed.
Fantastic and very timely plugin! Hopefully this will save me tons of time tinkering with htaccess files!
Any chance of wildcard redirects and/or a way of importing a csv file? This would be especially handy with some of the larger sites I’m trying to migrate to Textpattern.
Keep up the great work. Appreciated!
— Doug (Bristol Wen Design) · Thu Aug 18, 10:40 AM
@Doug, the CSV idea is good and not far off some of the ideas I’ve been knocking around. As for wildcard redirects, I considered this but as far as I am aware this cannot be done with the way the redirects are being checked in the database. In this scenario I think tinkering in the .htaccess file would be a better solution.
— Andy · Tue Sep 6, 06:43 PM
Thinking about it, I can see how implementing wildcards would be a bit of a nightmare and realistically this is only likely when a site is initially ported to Textpattern. I’ll just use the traditional .htaccess approach. CSV import/export would still be nice! ;-)
Also be nice if the plugin kept track of 404’s too and added those to a list of suggested redirects. Save having to keep an eye on the logs/webmaster tools and provides a nice way to get those urls into the plugin.
By the way, don’t let these suggestions stop you from arc_twitter!
All the best,
— Doug (Bristol Web Design) · Thu Sep 8, 12:31 PM