For many web pages, either method will work just fine without a bad impact on performance or SEO, however if your site has a single page with hundreds of links or more, then I'd go with method two and specify a default path via the BASE tag in order to not screw up links since that will cut down on code size and therefore reduce loading time.
So as an example, Instead of having the following in your HTML source code:
<a href="http://example.com/a/very/long/path/to/file.php?a=1">One</a>
<a href="http://example.com/a/very/long/path/to/file.php?a=2">Two</a>
<a href="http://example.com/a/very/long/path/to/file.php?a=3">Three</a>
<a href="http://example.com/a/very/long/path/to/file.php?a=4">Four</a>
<a href="http://example.com/a/very/long/path/to/file.php?a=5">Five</a>
You can have:
<base href="http://example.com/a/very/long/path/to/">
Along with:
<a href="file.php?a=1">One</a>
<a href="file.php?a=2">Two</a>
<a href="file.php?a=3">Three</a>
<a href="file.php?a=4">Four</a>
<a href="file.php?a=5">Five</a>
And its also a bonus if you can use friendly URLs, because then you could create a one-character hrefs such as this:
<a href="1">One</a>
<a href="2">Two</a>
<a href="3">Three</a>
<a href="4">Four</a>
<a href="5">Five</a>
And you can for example place this code that's accessible in a URL such as http://example.com/sections
. That way, when a link is selected, the number is added to the URL resulting in for example: http://example.com/sections/1
<a href="/contact.php">Contact</a>
. IMO this is the best choice in basically all cases. – Tim Fountain Aug 3 '15 at 16:52