Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2016-07-12 13:31:36

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,595
Website

Redirecting / rewriting legacy site links that overlap with txp's own?

I’ve transferred an ancient typo3 site over to txp, and want to catch existing links to the legacy site and redirect them to the corresponding pages on txp. The problem is, they share some characteristics with txp’s own messy url links.

For example:

index.php?id=20
index.php?id=20&type=28
index.php?id=20&type=28&cHash=119d0d71ac

There are only 15 pages or so, so I was trying to intercept them manually, adding this above txp’s own rules:

   RewriteRule ^index.php\?id=20(.*)$ /kontakt [R=301,L]

or

   RedirectMatch 301 index.php\?id=20(.*) http://domain.de/kontakt

But I always get txp’s own article with the id=20.

So:

a) I must be doing something wrong in the first place, because it’s not acting before txp
b) Is there a way to catch incoming links (e.g. from google or other sites) without also intercepting txp’s own links?

Another RewriteRule directly after the above for intercepting typo3’s fileadmin/(download/)?(.+) etc. -> /files/$2 is working correctly, so it’s not completely broken.

Any ideas?

PS: I tried this too, but also had no luck:

RewriteCond %{HTTP_HOST}@@%{HTTP_REFERER} !^([^@]*)@@https?://\1/.*

TXP Builders – finely-crafted code, design and txp

Offline

#2 2016-07-12 14:05:39

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,304

Re: Redirecting / rewriting legacy site links that overlap with txp's own?

Did you also consider SQLing up TXP IDs by 15?


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#3 2016-07-12 16:55:54

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,595
Website

Re: Redirecting / rewriting legacy site links that overlap with txp's own?

Thanks uli. That’s an interesting idea, and it might work for some individual article pages, but not for article list pages. For some reason, the typo3 ids go up to about 85 (I guess it assigns an id to every page chunk) although there are only a handful of pages that need redirecting.


TXP Builders – finely-crafted code, design and txp

Offline

#4 2016-07-12 23:33:01

kuopassa
Plugin Author
From: Porvoo, Finland
Registered: 2008-12-03
Posts: 228
Website

Re: Redirecting / rewriting legacy site links that overlap with txp's own?

Have you tried this kind of arrangement:

Redirect 301 /index.php?id=20 http://domain.de/kontakt

Offline

Board footer

Powered by FluxBB