permalinks – Custom links in menus not working in multiple environments
I have a top menu with links and for some of them I need to use “Custom links” instead of linking to pages. This mean I have to write www.sitename.com/pagename instead of WordPress directly referring to the page for me with page linking. This all works fine on the live (production) site.
When testing I use a stageing environment. All page links now go to www.stage_sitename.com/pagename which is good. However, the custom ones still go to the production site since I have hard coded them.
I have tried to use /index.php/pagename (answer from this question). This will take me to something that looks like root/index.php/pagename. The problem is that my staging environment looks something like this: www.stage_sitename.com/~currentsite. Root will take me to www.stage_sitename.com/index.php/pagename but the real stage page is at www.stage_sitename.com/~currentsite/index.php/pagename. I hope you get what I mean 🙂
How can I use custom links in menus that will work for all environments?