How to use variable absolute hyperlinks in wordpress post?

Posted on 2007-08-01
Last Modified: 2008-09-19
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?


What should I write inside for variable absolute hyperlinks?


Question by:shortandsharp
    LVL 11

    Expert Comment

    What is a "variable absolute hyperlink"

    Variable and absolute seem to be mutually exclusive

    Author Comment

    suppose your production server is

    a page is

    if that is to be deploy on my local server

    whose document root is f:wwwroot

    then absolute url on local server will be


    which is to said,  how to make localhost/adc/ the same as

    LVL 11

    Expert Comment

    That is a very good question, and it is the point I was making in

    It may be possible to do it with .htaccess, but I have never tried it

    Author Comment

    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

    if it is on localserver



    LVL 11

    Accepted Solution

    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, 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
    LVL 1

    Assisted Solution

    It's a really dirty way to do it, but you could probably use the RunPHP plugin

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

    <?php bloginfo('description'); ?>/abcfolder/index.php

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

    Hope this helps,
    LVL 15

    Expert Comment

    can we use like this?


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
    I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
    The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
    The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now