I have this blog (wordpress…) and i changed its permalinks in the follwoing way:
OLD : http://www.example.com/2015/05/04/my-post
NEW: http://www.example.com/my-post
so i simply removed the date from the link. the problem is i have many posts (thousands) published all over the net with the old structure.
there are qordpress plugins that allows you to create 301 redirect for a specific request but is there a way in the server level where i can do this 301 redirect without dealing with plugins etc..
the structure is consistent so even though i never worked with regex i guess it can help me here?? any other solutions will be highly appreciated ..thx
You need this rewrite statement somewhere in your
nginx
configuration:It is possible to place it inside a
location
block, but as that location block would need to use a regular expression too, it would probably save processing if this rewrite is left naked in the server context, that is placed somewhere near the top of yourserver
block.See this document for more.