wordpress the_permalink() breaks when wp home and site home are different

Solution:

After you change your site address, you have to copy your .htaccess and index.php files up one directory (in your case, copy them to [code]http://localhost/mysite/[/code]) then edit the index.php file to replace

require(‘./wp-blog-header.php’);
with

require(‘./wordpress/wp-blog-header.php’);
You can find the full instructions on how to do this at http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory#Using_a_pre-existing_subdirectory_install