Tried with 7.x-1.0-rc4 and -dev versions.

Tried with and without preceding slash in destination URL.

Example line that doesn't work:

/premier-plus-stat-2,/get-help-and-support/premier-plus

Delimiter is a comma - i.e , - i.e. the default - not changed. No spaces in delimiter - it is as default.
No headers box checked because no header in my import file.

The URL get-help-and-support/premier-plus on my site DOES exist.

But getting error: "Line 1: The destination "/get-help-and-support/premier-plus" URL/path does not exist."

Page with destination URL is published.

Comments

therobyouknow created an issue. See original summary.

therobyouknow’s picture

Issue summary: View changes
therobyouknow’s picture

I have made some progress on this but problem not yet solved.

It appears that the language option (and redirect code) ARE required and NOT optional - contrary to what the https://www.drupal.org/project/path_redirect_import module project page says:

Required fields are the Old URL and the New URL, Redirect code and Language fields are optioinal

- So this is incorrect.

So if I now use the following in my CSV
/premier-plus-stat-2,/get-help-and-support/premier-plus,301,en
This now gets added. However, the redirect does not work. When I look at: admin/config/search/redirect I now see an entry for the redirect, however this is an internal url in the format node/2282 and this URL itself works, but the redirect from my old URL to it does not - I get page not found.

therobyouknow’s picture

I now have this working, but not completely:

I needed to remove the preceding slashes so that:

/premier-plus-stat-2,/get-help-and-support/premier-plus,301,en

now looks like:

premier-plus-stat-2,get-help-and-support/premier-plus,301,en

However, for a redirect to the home (front) page, the redirect module defines this as <front> which works individually.

But if I use <front> for redirects imported via a csv using path_redirect_import, these redirects do not work. If I go to edit them individually, without changing but just re-save, they then work. They look the same as before going to edit, so I'm not sure what the issue is at the moment.

bserem’s picture

Version: 7.x-1.0-rc4 » 8.x-1.x-dev

This issue is valid for 8.x too. As a matter of fact, adding a redirect by hand works fine. Adding a redirect in batches doesn't work.
Out of 1000 redirects (I know...) only 25 are being imported.
Drush imports more (~300) but still fails on many, even though the destination paths exist.

At the moment I still fail to see where the problem originates.

What I've found out so far is:

1) If I clear caches and run an import several paths say they do not exist.
2) When I visit these paths I do get a 404 error.
3) If I clear caches and visit these paths, then the page responds just fine.
4) Re-running an import will succesfully import (well, at least some of them).

It looks like some caching is messing with the importer.

I would like to bump this up to "major", since the module doesn't seem usable for D8.

akalam’s picture

Version: 8.x-1.x-dev » 7.x-1.x-dev
Status: Active » Closed (duplicate)
Related issues: +#2897489: Doesn't work for if old URL contains percent encoding, 'special' characters or <front> or if new URL contains <front>

@bserem I think that if you try to access the url and you get a 404 that means that the url doesn't exists yet for drupal. The discovery process of new urls for drupal implies clearing cache.
Please check that the destination urls exists and that the csv format meets the example's one.
If still having problems please open a new issue.

@therobyouknow closing as duplicated of https://www.drupal.org/project/path_redirect_import/issues/2897489

bserem’s picture

The urls exist on drupal, but the module thinks otherwise.

In any case, I solved my issue by using a custom mass importer.
For people that stumble upon such a problem, here is the script: https://gist.github.com/bserem/60160a3d932ef69ec85ff7b7c1aa3ce8