The thing is Lets say I have my core files in a root and the admin panel in admin folder.

Now I use same sidebar for both.

The reference to certain files are now as follows

HTML Code:
<a href="example.php"> example </a>
example.php is in the root, and the sidebar as created keeping that in mind first, now when the sidebar is now being used by the admin pages as well.. that reference is trying to access something like this.. www.website.com/admin/example.php where the real link is www.website.com/example.php

I know I can put in direct link but that's not good practice I know... What is the good solutions for this?

tx