Feature Request, if anyone else would be helped by this...

We moved some of our old site into Drupal, and switched our main domain to Drupal. But our old site/content still exists, with a different URL, since it contains a ton of content that doesn't readily fit into Drupal.

All our internal links are correct on both sites. But Google and other search engines often follow external links, which now don't work. They *would* if we could implement suitable redirection so when the Drupal site gets hit by an old URL, the browser gets redirected to the old server's new domain.

For example:
www.advisor.com was the domain of our old site, it is now the domain of our new Drupal site.
my.advisor.com is now the name of our old site. All paths at the old site work, it just has a new (sub)domain.

It would be fabulous if Path Redirect could do this. But because the incoming path does not exist in Drupal, it won't accept the redirect entry.

OLD PATH: www.advisor.com/doc/*
must be 301 redirected to
NEW PATH: my.advisor.com/doc/*

No logical problem, because only the old site has /doc/ as content path; our Drupal site uses /story/

But Path Redirect won't accept this. Could it possibly work?

Or am I missing a concept?

Comments

HorsePunchKid’s picture

I haven't tried it out yet, but would the wildcard patch work in this scenario? If not, maybe it could be modified to handle this, too.

hawkdrupal’s picture

There's also a problem with <*> in the destination URL, which I reported several weeks ago. A response said it would be fixed soon, so I just tried the latest -dev version, dated 3 days ago, since it says "Latest features and fixes". But it appears to regress -- <*> is not mentioned, and the redirection I need to implement, which was partially OK before (FROM accepted, TO rejected), now is totally rejected:

FROM: articles.nsf/aid/<*>
TO: http://my.advisor.com/doc/<*>

I get these error messages:
* The redirect from path does not appear valid. This must be a local Drupal path.
* The redirect to path does not appear valid.

Of course, they are both valid in that they really exist, but not in Drupal. They are hits against Drupal that I'd like to send to the proper destinations. But this module doesn't like them.

HorsePunchKid’s picture

I'm not sure the wildcard patch ever got committed. Are you sure you weren't using a patched version and then upgraded to an unpatched version?

I'll see what I can do with the wildcard patch, though; look for an update in that issue. I'm not sure if jjeff intended it to go into the 1.1 release, but I can at least make sure that the patch will cover this case and apply cleanly to the dev branch.

casey’s picture

See http://drupal.org/node/198717; something like that will do the trick.

HorsePunchKid’s picture

Version: 5.x-1.1-beta1 » 5.x-1.x-dev

@casey: I'm not sure that's really the core issue here.

If I understand correctly, what's being asked for is that if you have a single Drupal install that responds to both http://foo.example.com/ and http://bar.example.com/ you should be able to create a redirect from one to the other.

It does sound a little bit outside the purview of path_redirect, and it would certainly be easy to do with mod_rewrite. (Basically my feeling on the wildcard issue, too, but I understand the value of being able to do it without mod_rewrite!)

HorsePunchKid’s picture

Status: Active » Postponed (maintainer needs more info)

I'm still not sure what this is about, aside from wanting wildcards.

yngens’s picture

i also need this feature. all the content of my pre-drupal site went to http://old.mysite.com. so all the links are the same except i need somehow automatically change 'www' in url of all address requests to 'old'.

wildcards can redirect many old urls to one single new url, while i need to preserve every single old url and change only 'www' to 'old'.

for example:

requests for:

http://www.mysite.com/l/photo/2006/03/03/fashion/1.jpg
http://www.mysite.com/l/photo/2006/03/03/fashion/2.jpg
...
http://www.mysite.com/l/photo/2006/03/03/fashion/100.jpg

should go to:

http://old.mysite.com/l/photo/2006/03/03/fashion/1.jpg
http://old.mysite.com/l/photo/2006/03/03/fashion/2.jpg
...
http://old.mysite.com/l/photo/2006/03/03/fashion/100.jpg

etc...

there are very interesting instructions regarding some problems close to this on http://drupal.org/node/38960, but unfortunately i could not get it work. does anyone believe my problem could be solved by Path Redirect module? what exactly i should do?

thanks!

yngens’s picture

Interested in the issue users, please also look at: http://drupal.org/node/182512#comment-699382

HorsePunchKid’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

At this point, this sounds like a duplicate of the wildcard issue. If someone can explain why it isn't, I'm all ears. Just set this issue back to "active" and let me know what exactly the necessary feature is.