Welcome! Log In Create A New Profile


Problem in change URL and remove a phrase

Posted by ariya 
Problem in change URL and remove a phrase
May 08, 2021 04:41AM
Hello. Previously my site URL was as follows and there was an extra "forum" word at the end of the URL:


I managed to remove the word "forum" from the end of the URL using the following rewrite, and my URL became https://mysite.com/forums.

rewrite ^ / forums / forum $ https://mysite.com/forums permanent;

There are now a number of other old URLs that do not work with rewrite above. For example, the following address:


The "forum" phrase in the middle of the url should be removed and then converted to the following address:


But this does not happen. I also put the following rewrites in the Nginx configuration file but the "forum" phrase is still in the middle of my urls.

rewrite ^ / forums / forum $ https://mysite.com/forums(.*)$1 last;
rewrite ^ / forums / forum $ https://mysite.com/forums$1 last;
rewrite ^ / forums / forum (. *) \. html $ /forums(.*)$1 last;
rewrite ^ / forums / forum (. *) $ /forums(.*)$1 last;

Where is the problem and how can I remove this word "forum" from the middle of my URLs?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 180
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready