How to use variable absolute hyperlinks in wordpress post?

How to use variable absolute hyperlinks in wordpress post?

if it is links within my post it is definitely possible to user variable absolute hyperlinks?

<?php

?>
What should I write inside for variable absolute hyperlinks?

thanks


shortandsharpAsked:
Who is Participating?
 
singletonConnect With a Mentor Commented:
If the directory structure does not change, you can use relative addressing. I.E. a file http://localhost/abcserver/index.html can refer to http://localhost/abcserver/123.html by just saying 123.html, and it can reference http://localhost/abcserver/folder1/123.html by just saying folder1/123.html, but you need to make sure you dont change the directory structure when moving it, and you definitely do not want to use a full permalink, which would be http://localhost/abcserver/123.html, because once you moved it to abc.com, that permalink would not work. You might be able to remap it with the ".htaccess" file; one can do a lot with that file, and I have just done a little with it, but your safest way is to make sure any internal references are relative, which means you cannot change the directory structure when you move it
0
 
singletonCommented:
What is a "variable absolute hyperlink"

Variable and absolute seem to be mutually exclusive
0
 
shortandsharpAuthor Commented:
suppose your production server is http://www.aba.com/

a page is http://www.aba.com/123.htm

if that is to be deploy on my local server

whose document root is f:wwwroot

then absolute url on local server will be

http://localhost/abchost/123.htm

which is to said,  how to make localhost/adc/ the same as www.abc.com/

thanks
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
singletonCommented:
That is a very good question, and it is the point I was making in http://www.experts-exchange.com/Web_Development/Blogs/WordPress/Q_22728504.html#a19616253

It may be possible to do it with .htaccess, but I have never tried it
0
 
shortandsharpAuthor Commented:
pardon me I'm not a native English speaker.

What I mean is if I made a post

inside the post how to I make my hyperlinks within my url absolute hyper link independent of where the blog is?

if it is on blog

http://abc.com/123.html

if it is on localserver

http://localhost/abcserver/123.html

thanks

0
 
stubooConnect With a Mentor Commented:
It's a really dirty way to do it, but you could probably use the RunPHP plugin
http://wordpress.org/extend/plugins/runphp/

and then use wordpress tags for the beginning of the url so that

http://localhost/abcserver/index.php
http://yoursite.com/abcfolder/index.php
<?php bloginfo('description'); ?>/abcfolder/index.php

could all be the same, link no matter where you upload the site.

Hope this helps,
Ryan
0
 
dosthCommented:
can we use like this?

"http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.