How to use variable absolute hyperlinks in wordpress post?

Posted on 2007-08-01
Medium Priority
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

ID: 19609040
What is a "variable absolute hyperlink"

Variable and absolute seem to be mutually exclusive

Author Comment

ID: 19616523
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


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

LVL 11

Expert Comment

ID: 19616615
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.


Author Comment

ID: 19616715
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

singleton earned 1000 total points
ID: 19616821
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

Assisted Solution

stuboo earned 1000 total points
ID: 19872288
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

ID: 21983651
can we use like this?


Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can use conditional statements using Python.
The title says it all. Writing any type of PHP Application or API code that provides high throughput, while under a heavy load, seems to be an arcane art form (Black Magic). This article aims to provide some general guidelines for producing this typ…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Suggested Courses
Course of the Month14 days, 21 hours left to enroll

840 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