If you need to upgrade your PGV installation, then hopefully you will also consider that you can conveniently move to webtrees with our PGV-to-webtrees wizard. It will move ALL your users, news, favorites and family trees to webtrees in a matter of minutes.

TOPIC: [SOLVED] How can I make the 301 redirect rule take effect

How can I make the 301 redirect rule take effect 7 months 2 weeks ago #1

  • xmlf
  • xmlf's Avatar
  • Offline
  • New
  • Posts: 69
I have switched from phpgedview to webtrees. The URL structure of webtrees and phpgedview is different.
I want to use the Rewrite rule for 301 redirects. I configured the redirect rule in nginx, but it doesn't work.
I checked that the default setting for webtrees is that it can still be accessed using the old URL of phpgedview.
This can result in a lot of duplicate content appearing on two different URLs. This is very unfriendly to search engines.
How can I make the 301 redirect rule take effect?
Wang Family Website of Suining County, China
https://www.snwsjz.com
A family tree website that is customized, more humanized and convenient for users.
The administrator has disabled public write access.

How can I make the 301 redirect rule take effect 7 months 2 weeks ago #2

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Posts: 11610
> I configured the redirect rule in nginx

Can you share the nginx configuration?

> but it doesn't work.

What happened? Give an example?
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net
The administrator has disabled public write access.

How can I make the 301 redirect rule take effect 7 months 2 weeks ago #3

  • xmlf
  • xmlf's Avatar
  • Offline
  • New
  • Posts: 69
Nginx rule:
rewrite ^/individual.php?pid=(.*)&ged=(.*) /index.php?route=individual&xref=$1&ged=$2 permanent;

Example:
www.zisun.org/individual.php?pid=X333&ged=ke
And
www.zisun.org/index.php?route=individual&xref=X333&ged=ke

Both can access the same content. And the return http status code is 200.
Wang Family Website of Suining County, China
https://www.snwsjz.com
A family tree website that is customized, more humanized and convenient for users.
The administrator has disabled public write access.

How can I make the 301 redirect rule take effect 7 months 2 weeks ago #4

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Posts: 11610
Perhaps this rule is applied *after* your existing rules.

Since there is already a file individual.php in webtrees, this one is used.

I guess the file in webtrees should be updated to return a 301. Raise a ticket on github.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net
The administrator has disabled public write access.

How can I make the 301 redirect rule take effect 7 months 1 week ago #5

  • xmlf
  • xmlf's Avatar
  • Offline
  • New
  • Posts: 69
Is my nginx rule configuration error.
In the nginx rewrite rule, the "?" processing method is different.
However, the old URL can still be browsed by default, which is still very unfriendly to search engines.
Wang Family Website of Suining County, China
https://www.snwsjz.com
A family tree website that is customized, more humanized and convenient for users.
The administrator has disabled public write access.

[SOLVED] How can I make the 301 redirect rule take effect 7 months 1 week ago #6

  • xmlf
  • xmlf's Avatar
  • Offline
  • New
  • Posts: 69
Problem solved.
Wang Family Website of Suining County, China
https://www.snwsjz.com
A family tree website that is customized, more humanized and convenient for users.
The administrator has disabled public write access.
Powered by Kunena Forum