Redirection problem with similar URL’s
-
I have strange problem with redirection in WordPress. There are two pages with similar permalink:
https://www.example.com/finance
https://www.example.com/finance-and-accounting
After entering on
/finance-and-accounting
address, WordPress redirects to the/finance page
.When I change
/finance-and-accounting
to, for example/123finance-and-accounting
it’s work fine, but I need current address. I tought that change current address to something working and add redirect from/finance-and-accounting
to new address will good solution but…Wordpress root folder don’t have .htacces file, but includes nginx.conf file, so I guess it’s on nginx server. Important – this nginx.conf file was empty.
I tried add following code to nginx.conf:
location /finance-and-accounting { rewrite ^(.*)$ https://www.example.com/new-address redirect; }
and
location https://www.example.com/finance-and-accounting { rewrite ^(.*)$ https://www.example.com/new-address redirect; }
also
remove_action('template_redirect', 'redirect_canonical');
in functions.phpBut it’s not work. It still redirect to /finance page.
- The topic ‘Redirection problem with similar URL’s’ is closed to new replies.