Changing base url to allow relative links
I have a Wordpress site that is located in a sub-directory:
However, when I create link in my website I must include the sub-directory folder in my relative urls, or the path will be incorrect. This is a problem because I am always transferring websites, and it's becoming tedious.
Is there a way to force the root url as http://www.example.com/subdirectory when creating relative urls?
For example, I would like to create a relative url in my pages without having to worry about the extra folder being included (i.e. I want to write it like this in my pages '/wp-content/theme/twentyten/images/sample.png')
<base href="http://www.example.com/subdirectory"> or, for links to open in new tabs: <base href="http://www.example.com/subdirectory target="_blank">
You should add this to your header.php in Appearance > Editor