Just going through the list of QA items for a client and got to:
Setup HTTP redirect in settings.php.

Although you can do this with PHP, would likely to be better to do this in Apache if you can.

Also would be good to point to where fixing old links (in general) is defined as a best practice within Drupal and add it to the QA list.

Comments

traviscarden’s picture

Status: Active » Closed (duplicate)

You're right, @mgifford. Let's fix this and other issues at #1645936: Re-invent QA Checklist.

eidolon night’s picture

Issue summary: View changes

Pantheon, who we love, recommends using settings.php: http://helpdesk.getpantheon.com/customer/portal/articles/368354-redirect...

Using settings.php or wp-config.php for redirects has a number of advantages. First, as it's executable code with application state awareness, logic and decisions can be made that a web server would have no context for. Conditional logic, regular expressions, and much more are possible.

Configuration also tends to be more maintainable as Drupal and WordPress developers are typically literate in PHP, but very few people are naturally fluent in Apache2 rewrite rules and conditions.

Finally, as settings.php or wp-config.php is parsed very early in the bootstrap process, redirects like this are "cheap", meaning low overhead. If you use a 301 redirect, Varnish will cache it as well!