I have a page on WordPress, it’s slug is http://example/wordpress/page
. I also have a second page, and it’s slug is http://example/wordpress/page2
.
I want to a link in the first page that links to the second page. So I tried the following:
/page2/
– leads tohttp://example.com/page2
❌/../page2/
– leads tohttp://example.com/page2
❌page2/
– leads tohttp://example.com/wordpress/page/page2
❌../page2/
– leads tohttp://example/wordpress/page2
✔
But problem is WordPress converts ../page2/
to http://../page2/
which obviously doesn’t work.
So what can I do to fix this? I don’t want to hardcode the url, as the site could be accessed from wordpress.example.com
and example.com/wordpress