Path Redirect could perform an export of its rules to file-based storage. This way redirects could be performed by webserver, skipping php completely. The action would be performed manually by developer or site admin, from time to time, or even programmatically.
I think this feature would fit nicely as additional feature to increase performance, not completely replacing drupal-based redirects but complementing it: webserver redirects and drupal redirects could be combined using any ratio (based on human decision or an algo).
I also suggest to make export operations as plug-ins so different formats could be supported (Apache .htaccess, nginx rules etc).

Comments

dave reid’s picture

Project: Path redirect » Redirect
Version: 6.x-1.x-dev » 7.x-1.x-dev

Out of scope for 1.0 features, so moving to the new redirection api module for consideration.

dave reid’s picture

Status: Active » Postponed
mlncn’s picture

Anyone tried this in any form yet? Would be hugely useful.

mlncn’s picture

Status: Postponed » Needs work

OK i went and started it: http://drupal.org/sandbox/mlncn/1371080

The redirects thus produced are completely untested, recommendations welcome.

dave reid’s picture

Status: Needs work » Active

No patch = active

greggles’s picture

Now that there's a separate module I suggest this issue be "works as designed" or something and a link to that module added to the project page.

dave reid’s picture

Status: Active » Postponed

I'd still like to leave this as postponed for something to consider after 1.0 release.

mlncn’s picture

It's just a sandbox module and could become a patch to or submodule of of Redirect, and i will wait for Dave Reid's call on that. It is tested and works and now exports in two styles Apache uses, Redirect and using Rewrite Rule.

http://drupal.org/sandbox/mlncn/1371080

However it was written with the intention of disabling Redirect module entirely as the cleanest workaround to #1370964: Redirect interferes with hook_custom_theme. Much, much cooler would be to allow Redirect module to be configured to take no action in hook_init() ever, but instead export its rules automatically. Direct export of redirect rules to Apache is theoretically possible.

jordanmagnuson’s picture

This looks like a really good idea.

jordanmagnuson’s picture

Just used mlncn's sandbox module today to export about 5000 redirects, and it worked like a charm. Nice work Benjamin! Exporting redirects as Apache rules automatically would be really, really awesome.

In any case, I think your sandbox module is far enough along already to deserve a full release (or integration into the redirect module).

(The one tiny thing I would point out is that the module name should match the directory/project name: redirect_export.module, rather than redirectexport.module.)

liquidcms’s picture

just a comment..

i havent looked at this module yet but it does sound like the better performance way to go. but sadly, my starting point is a csv file of redirects, and since neither Redirect or (i'm guessing) this module have direct import capability; i am still without a method to import.

so ideally either this module or redirect would allow for import from a csv file

jordanmagnuson’s picture

I agree that import capability would be nice. Perhaps "redirect_import_export"?

mlncn’s picture

Released http://drupal.org/project/redirect_export as a full project since it was requested of me and is working for people. I'd love someone to take on automatic export but for me the module is bugfix only right now.

As for importing and then exporting, if you want to go straight from CSV to Apache rules, i'd recommend just using a spreadsheet to make a formula to manipulate the paths into producing the rules and copy paste the result.

honza pobořil’s picture

Issue summary: View changes

If you care about performance, just use reverse proxy (Varnish, ...). It will cache not only pages but redirects too.

greggles’s picture

Re #14, while I agree that a reverse proxy is a great solution, it isn't always an option. Especially on shared hosting solutions there's just no way to do that. Are you poposed to this feature or just voicing some advice/insight?

pere orga’s picture

Answering #11, redirects can be imported by Path redirect import.

wylbur’s picture

Status: Postponed » Closed (outdated)

Closing this as Outdated as Drupal 7 is EOL.

c-logemann’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
Status: Closed (outdated) » Active

Open Issue again because functionality still makes sense for D11+.