deepak-rajpal
5/7/2013 - 1:47 PM

WordPress or php site: Relative urls instead of Absolute, Relative Urls type

WordPress or php site: Relative urls instead of Absolute, Relative Urls type

1) if using "/" at first but not http it will add to the site.com (Most preferable, no need to change after move)
<a target="_blank" href="/blog/2012/10/19/sample-post-article/">sample article</a>
Result: http://site.com//blog/2012/10/19/sample-post-article/
2) if not using "/" at first, and not using http it will add to the current url
<a target="_blank" href="blog/2012/10/19/sample-post-article/">sample article</a>
current url: http://abc.com/def/gih/
http://abc.com/def/gih/blog/2012/10/19/sample-post-article/
3) if using "../" at first, and it will go back one directory of the current url and add
<a target="_blank" href="blog/2012/10/19/sample-post-article/">sample article</a>
current url: http://abc.com/def/gih/
Result: http://abc.com/def/blog/2012/10/19/sample-post-article/