0

I have created an ad for a merchant wanting to rent ad space on my website home page. After creating the ad, (anchor text and pic/graphics with embedded hyperlink) the merchant has requested I remove my url from the ad code. The anchor text along with the embedded hyperlinks links to the merchant's home page.

Problem is I don't know how my url was added to the code as I never inputted it in the original code in the first place. Somehow it was added by I think, WordPress or my server (PHP).

When I view the page source I do see my url was added to the ad code.

Can anyone help explain this and tell me how I can remove the url? Also, if I am able later to remove my url, how will it affect the hyperlink and anchor text?

Thank you, -Dan

Hi s_ha_dum,

I have read your answer and have now made sure the code reads as abosolute url.

Here it is with absolute url:

<strong>If you are interested in helping others treat and prevent hypertension, consider a healthcare degree from <a href="http://elearning.loyno.edu/">Loyola Online Courses today!</a></strong>

It still shows in page source however with my url addended to the code string.

What am I not understanding? Thank you!

6
  • 2
    Please post the relevant code. I don't see how this can be answered without that. Commented Feb 24, 2013 at 6:00
  • Thank you...here is the ad code as I inputted it inside the article itself via WP-Admin's 'Edit Page' function while using html view: Commented Feb 24, 2013 at 13:09
  • <strong>If you are interested in helping others treat and prevent hypertension, consider a healthcare degree from <a href="elearning.loyno.edu/">Loyola Online Courses today!</a></strong> <a href="elearning.loyno.edu"> <img src="managementofhypertension.com/wp-content/uploads/2013/02/…" alt="" /></a> Commented Feb 24, 2013 at 13:09
  • Code as it appears in page source view <strong>If you are interested in helping others treat and prevent hypertension, consider a healthcare degree from <a target="_blank" rel="nofollow" href="managementofhypertension.com/goto/http://elearning.loyno.edu" >Loyola Online Courses today!</a></strong> Commented Feb 24, 2013 at 13:16
  • Edit your question to include the code, please. Code is hard to read in the comments. Commented Feb 24, 2013 at 14:34

1 Answer 1

2

Your problem is that you are using relative URLs-- that is URLs, that include only part of the web address. What is taking on your URL is the browser, not WordPress. Browsers have long done this. Here is how it is supposed to work.

If you provide an absolute URL nothing happens-- for example, http://www.example.com. The idea is that you can use shorthand version of the URL. If you had a directory at /filesystem/path/to/www.example.com/images/ then a file named here.html located at http://www.example.com/here.html could use urls like images/image1.jpg to load the images. The browser will assume the first part of the URL is "this URL" and create http://www.example.com/images/image1.jpg. The relative URL is always relative to "this URL".

What is happening in your case is that you are providing the relative URL of, for example, elearning.loyno.edu/, so the browser is filling in the rest creating http://yoursite.com/elearning.loyno.edu/. Your URLs are relative because you've left off the scheme-- the http:// part. (My editors do it too.... a lot. :) )

You just need to provide the complete, absolute url for those links-- aka., add the http:// bit.

While it doesn't effect you in this case since you are loading external URLs, this relative URL issue is especially tricky inside WordPress because pages don't really load from the locations they appear to load from, at least not when pretty permalinks are enabled. In short, just don't use relative URLs.

1
  • Hi @s_ha_dum, I have responded to your comment inside my question by editing the question. Commented Feb 24, 2013 at 16:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.