Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2017-10-17 19:33:21

kees-b
Member
From: middelburg, nl
Registered: 2004-03-03
Posts: 235
Website

Rewrite old section to new

Hi,

We have a section name that has to be changed. Only there are a few articles that need to stay accessible with the old and new url. I tried to make a rewrite rule that covers this but I can’t get it working as it should. It rewrites to the new section but doubles the article title… What goes wrong here?

This is the rewrite rule:
RewriteRule ^oldsection/(.*) https://domain.com/newsection/$1 [R=301,L]
I also tried:
RewriteRule ^oldsection/(.*)$ https://domain.com/newsection/$1 [R=301,L]

But with both rules this happens:
https://domain.com/oldsection/article-name => https://domain.com/newsection/article-name/article-name

What do I have to change to make this work?

Kees

Offline

#2 2017-10-17 20:34:55

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Rewrite old section to new

This works in my .htaccess:

Redirect permanent /oldsection http://domain.com/newsection

Offline

#3 2017-10-17 21:01:54

kees-b
Member
From: middelburg, nl
Registered: 2004-03-03
Posts: 235
Website

Re: Rewrite old section to new

Thanks Els! How easy can it be…

Kees

Offline

Board footer

Powered by FluxBB