Q:

URL Doubles In Size On Link Click With Mod_Rewrite

Currently I am having the WEIRDEST issue! :( Whenever I click on a click it doubles in size, and I assume it is because of the .htaccess file. First off let me post my .htaccess file to you:
Options +FollowSymLinks
RewriteEngine on

# skip all files and directories from rewrite rules below
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]

RewriteRule ^[\w.'@\\\/-]+/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/?$ posts.php?sortby=$1&sorttime=$2 [NC,L]
RewriteRule ^[\w.'@\\\/-]+/([a-zA-Z0-9]+)/?$ posts.php?sortby=$1 [NC,L]
RewriteRule ^[\w.'@\\\/-]+$ posts.php [NC,L]

<Files .htaccess>
order allow,deny
deny from all
</Files>

Now before I explain a bit more I would like to say that I am using a localhost (not the issue, other pages work fine). I would also like to tell you the file path to the .htaccess and the posts.php.
localhost/postin'/categories/{category}/{var1-optional}/{var2-optional}
Now the {category} part can change, so that is why it is the [\w.'@\\\/-]+. That is the part that links it up to the posts.php. OK, now to the problem at hand! Lets say I am on the URL:
http://localhost/postin'/categories/coding/popular/today
                                    ^category ^var1 ^var2

And from that page I click on a button that takes me to 
http://localhost/postin'/categories/coding/views/today

That url will actually take me to:
http://localhost/postin'/categories/coding/popular/localhost/postin'/categories/coding/views/today

So my question is why do links double in size when I click on them? 
P.S. I have another .htaccess in another folder on my website, and links in there work perfectly fine!

A:

Explanation to the OP's problem : 
There was nothing wrong with his .htaccess, only the way his href(or link) was built.
Here's the full explanation
linking without a protocol (// or http://), and without a relative path(/), simply adds the path of the link to the current URI. so going from www.example.com through a link with the href="foo.com" will lead us to www.example.com/foo.com , the link should be href="http://foo.com"; to really redirect. You could see that from your last URL, you can see that the new URL was appended to the end of the origin

