# Summary

Allows users to redirect from old URLs to new URLs

  • Common API for loading, saving, and deleting redirects.
  • Case-insensitive redirect matching with a hook to allow other modules to narrow-down the candidate redirects.
  • Redirect counter and last used timestamp, with automatic cleanup of inactive redirects.
  • Integration with Drupal's page cache to optimize redirects and performance.

# Project URL

https://www.drupal.org/project/redirect

# Where is the code?

http://cgit.drupalcode.org/redirect
https://github.com/md-systems/redirect Deprecated

# Estimated completion date

Unknown.

# Dependencies

None

# Who's doing the port?

MD Systems

# What help do they need?

# D8 roadmap

#2837853: Plan for Redirect v8.x-1.0 release

# Background and reference information

Comments

giancarlosotelo created an issue. See original summary.

webchick’s picture

Title: Redirect » [redirect] Redirect
Benia’s picture

That's the only module that I actually MUST have (or thus it seems) before safely moving to Drupal 8... Hope you guys finish it soon...

berdir’s picture

Assigned: Unassigned » berdir

Then try out our port and test it. We've been using it on production sites since the beginning of this year and it is pretty stable, with only very few changes over the last few month.

Benia’s picture

Hello Berdir, are you guys developing the formal port? Is this the formal to-be-released version of the module? If yes, I would like to help in QA. I'm not yet a programmer, I just study some JS, so I can't really do anything besides testing it on my site.

If it's the formal TBR version, just let me know where can I download it? Github maybe?

Blessings,

berdir’s picture

Hi

Yes, as official as it can be I guess ;) The link to the github repository is in the issue summary (https://github.com/md-systems/redirect). All github projects have a handy "Download ZIP" button on the right site.

jhedstrom’s picture

What do we need to do to get the github repo back to d.o.? The code on github is at least beta quality I think, possibly RC ready.

jhedstrom’s picture

Benia’s picture

I've installed the module from GitHub and I now use it... I have a longgg list of re-directs in my Drupal 7 site... Some were created with Global-Redirect, and some others manually...

Is there a way I could migrate only these redirections to my new Drupal 8 site? I am not talking in any way on a full migration as with Migrate-update/Drupal-upgrade/Whatever you wanna call it, but only and solely on migration of redirects from the module Redirect 7.x.x to the current Redirect 8.x.1.x ... Is this possible?

Thank you so much!!!

andypost’s picture

We could get parts of it into core for 8.1
And makes sense to make 8.x alpha version of module

sime’s picture

Tried the github version and cannot create redirects - form silently fails (does nothing), no watchdog errors/etc.

mstrelan’s picture

Github version (downloaded today) worked for me, adding redirects from /admin/config/search/redirect/add as well as the automatic redirect after changing a node's alias. I'm on Drupal 8.0.2 and PHP 7.0.2.

juampynr’s picture

We are currently figuring out the list of features present in the Drupal 7 version which are missing at https://github.com/md-systems/redirect. Once we know them, Dave Reid will help us porting the module from GitHub to Drupal.org.

sime’s picture

looks great!

rphair’s picture

Just tested the latest github version and basic features all working great. On Drupal 8.0.3 and PHP 5.6.17.

toelli’s picture

redirect-8.x-1.x does not seem to work when adding redirect manually under /admin/config/search/redirect/add

The first field (Path) has some kind of ajax validator that just keeps putting it in focus no matter what i write or when i try focus other fields.

I'm using core Drupal core 8.0.4.

I want to add custom path that was used on old website and map it to redirect to the current path for that page on the website, is this not possible?

juampynr’s picture

@toelli, did you install https://github.com/md-systems/redirect ? Please have a look at the opened issues there and create one if you can't find it.

berdir’s picture

That bug has been fixed, make sure you are using the latest version. As a workaround, you can fill out the destination first and then the path, then it should also work.

jesse.voogt’s picture

I've got a D7 site that is using the redirect module which I need to port to D8. Looking at the table structure I can get an idea of how to port my existing redirects from D7, but it's not as straightforward as importing a field. If I wanted to import using MySQL, how would I go about this?

Please note that I've already gone through the D8 migrate process, so my site data is pretty much migrated already. I noticed there's a file "d6_path_redirect.yml" in the migration_templates folder, but no corresponding D7 file, but even if there was I'm hoping for a straight MySQL approach...

ksavoie’s picture

Sorry for my ignorance but what is keeping this module from appearing in Drupal's native repo? If I install the git version and the project end up in Drupal repo will updating operate normally?

agoradesign’s picture

@ksavole
The codebase will be the same later in Drupal repo. Regarding updates in general: as long as there is no stable release, or at least a release candidate, you don't have the guarantee that there will be update scripts at all. So you have to do every update carefully, look at the commits before and should test it before in a local or staging environment.

To your first question: I would also prefer to have it here. We are already using the github version in several production sites without any problems so far. So +1 for this!

ksavoie’s picture

Thanks for the info.
One question, I have this installed and maybe am under the false impression that one of its functions was to auto redirect to path alias if exist? (e.g. /node/123 ->301s-> /friendly/path)
Am I mistaken?

agoradesign’s picture

No, you aren't mistaken. That's what Redirect module is for... Doesn't it work for you? Never had problems so far. On multilingual sites, you need a patch. I've created one and posted it on the following issue entry on the github repo: https://github.com/md-systems/redirect/issues/53

ksavoie’s picture

Argh, yes was working for me. Of the dozens of pages in my site I so happen to have a duplicate named pair for which the wrong one ended up in my menuing. Sorry for the alarm.
It so happens that my site is setup for multilingual but only English installed/used. Had to put it in due to a compatibility issue with another module in my specific use-case.
Works fine without the multilingual patch.
Great module b.t.w.!

bloomt’s picture

I am a little confused, the drupal 8 redirect module will be used instead of the global redirect module? When will the module be ready or ported to drupal.org?

mrf’s picture

@bloomt Global Redirect has been merged with Redirect for Drupal 8. See: #2579177: [globalredirect] Global Redirect (use Redirect instead). Not sure on timeline on move to Drupal.org, but I can confirm the Github code is usable and ready to be fully vetted.

bart vanhoutte’s picture

Any news on the move to drupal.org?

agoradesign’s picture

+1 for the move to d.o - I was giving a fully composer based Drupal build a try these days. Having Redirect on Github + some permission problems I had on my VM was forcing me to enter my Github API token at every Composer update...

dave reid’s picture

Status: Needs work » Needs review

I just pushed the 8.x-1.x branch from https://github.com/md-systems/redirect back here to Drupal.org and will be filing beta-blocking issues.

agoradesign’s picture

Thank you very much!!!

geerlingguy’s picture

@Dave Reid - With the merge back to Drupal.org, just to confirm—is the basic Global Redirect functionality now available in the -dev release? It might be good to add a note about that (current status of how that module's merger into this one) in the Issue Summary, and maybe even a note in #2579177: [globalredirect] Global Redirect (use Redirect instead) as well, for the benefit of those looking to use Global Redirect's functionality on a Drupal 8 site.

berdir’s picture

#2579177: [globalredirect] Global Redirect (use Redirect instead) *is* the note that it has been merged into redirect.

And yes, it has been.

The implementation is subject to change, however. #2641118: Route normalizer: Global Redirect in core will probably get into core eventually, and it's possible that we will switch to that approach until that happens (and afterwards remove our own implementation).

elijah lynn’s picture

Issue summary: View changes
ressa’s picture

Would it be possible to tag release blocker issues, and link to them (perhaps under Summary?) so we can get Redirect closer to getting covered by Drupal’s security advisory policy?

webchick’s picture

Issue summary: View changes

I got pinged to look into this today, as many site builders are (smartly) increasingly uncomfortable installing modules on their sites that are not covered by the Drupal Security Team.

This one's an interesting one, because it doesn't even have a stable D7 version, meaning at no time in the history of this module has it ever been supported by the security team. Nonetheless, it's extremely popular, at > 200K installs, and #36 of the top installed projects overall, so getting it stable sooner than later would really help D8 adoption.

The issue queue currently has 260 open issues overall, 59 of them against Drupal 8. If we restrict that list to only bugs and tasks, it goes down to 31 issues.

I see there is a plan issue for an 8.x-1.0 release at #2837853: Plan for Redirect v8.x-1.0 release, created by @DamienMcKenna back in December, but it looks to be just a stub at the moment. Some visibility there around what issues are RC/release-blocking would be greatly beneficial, so people know where best to focus their efforts. There is only one critical issue (looks recent, caused by changes in 8.4.0: #2915430: Fatal errors instead of redirect) and a handful of majors, but I'm not sure how well the queue has been triaged, and what of those block release.

There is an offer to co-maintain at #2873369: Offering to co-maintain Redirect where the current maintainer, @Berdir notes (correctly) that there are not currently RTBC issues that aren't being committed. So it seems like for those who want to get this module out sooner than later, the best course of action is to get active in the queue, testing "needs review" patches, closing duplicate issues, etc. In a quick eyeball, it looks like most of the current "needs review" issues still need automated tests written for them, so that's a good place to start.

Anything I missed?

wim leers’s picture

I just spent an hour to go through about half of all the open Redirect D8 issues, triaging them. Closed some, RTBC’d some, NW’d some. Hopefully that helps.

damienmckenna’s picture

Thanks Wim, that helps a lot.

berdir’s picture

wim leers’s picture

🎉

ressa’s picture

Thank you Berdir, webchick and Wim Leers, and everybody else involved in creating the first stable release of Redirect for Drupal 8, what a great Christmas gift :-)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.