We are using SP2013, and have created an application page (policy.aspx), deployed via VS into layouts folder. Our environment has 1 web app with multiple site collections. The policy page should be accessible to all users.
At moment we have hardcoded the path of the policy page to sitecol1_layouts\test\policy.aspx and notice that suppose USER A tries to access this page from sitecol1 then he can access because he is member of this site col. However, if User B (member of sitecol2) tries to access this path then he gets error, however, a solution to this is to dynamically generate the current site URL and then appends the _layouts\test\policy.aspx to it.
Now, this works, I want to know if this is the only solution.