I use xampp on my local and I work on different projects. I generally use included top menus on web sites.
Directory Example:
C:\xampp\htdocs\site1
C:\xampp\htdocs\site2
In an included top menu I give links as
<a href="/site1/page1">Link</a>
<a href="/site1/page2">Link</a>
....
<a href="/site1/page7">Link</a>
But when I upload the site on a remote server, this links doesn't work. Because the root folder is not htdocs
. The root folder is site1
or site2
whatever..
While I am working on site1
, on my local, I have to set my default root directory to "site1" and I give links as
<a href="/page1">Link</a>
<a href="/page1">Link</a>
and it works for both (local-remote)
Question: How can I give the links in an included top menu without changing the local root directory.. I have tried as ../page1
. For main pages it worked but for sub pages didn't work..