Title: wordpress link problem
Last modified: August 31, 2016

---

# wordpress link problem

 *  Resolved [bgva2005](https://wordpress.org/support/users/bgva2005/)
 * (@bgva2005)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/wordpress-link-problem-1/)
 * Hi inside a visual editor I have this code:
 * `<a href="/index.php?p=895"> 2016</a>` what I need is that when I press the link
   the application will be redirected to the next link: href=”[http://localhost:8080/gobiernoabiertoII/?page_id=895″but](http://localhost:8080/gobiernoabiertoII/?page_id=895″but)
   currently it is doing this:
 * href=”[http://localhost:8080/index.php?p=895&#8243](http://localhost:8080/index.php?p=895&#8243);
 * How do I insert the domain: localhost:8080/gobiernoabiertoII/
 * Please your help
 * Thanks

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/wordpress-link-problem-1/#post-7358629)
 * Why not do this instead?
 * `<a href="http://localhost:8080/gobiernoabiertoII/?page_id=895">2016</a>`
 *  Thread Starter [bgva2005](https://wordpress.org/support/users/bgva2005/)
 * (@bgva2005)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/wordpress-link-problem-1/#post-7358670)
 * Hi James Huff
    I know that is going to work but I want ot understad what is hapening,
   why is the reason that is not working because in another page that option work
   withou problem.
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/wordpress-link-problem-1/#post-7358681)
 * Well, the reason it isn’t working is because `<a href="/index.php?p=895">` is
   a relative URL. It inherits whatever the URL in the browser currently is.
 * So, let’s say that link is in a post lets called it `example.com/2016/05/08/test/`
 * When clicked while viewing the post directly, the result will be `example.com/
   2016/05/08/test//index.php?p=895`
 * When clicked while viewing the post on the main page at `example.com`, the result
   will be `example.com/index.php?p=895`
 * When clicked while reading your RSS feed in the web-based feed reader [https://www.newsblur.com/](https://www.newsblur.com/)
   the result will be `newsblur.com/index.php?p=895`
 * Which is all to say why relative links are terrible and you should never use 
   them. 😉
 * Always use absolute links, like `<a href="http://localhost:8080/gobiernoabiertoII/?
   page_id=895">`
 *  Thread Starter [bgva2005](https://wordpress.org/support/users/bgva2005/)
 * (@bgva2005)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/wordpress-link-problem-1/#post-7358776)
 * Thanks James Huff, I am going to follow you advice.
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/wordpress-link-problem-1/#post-7358786)
 * You’re welcome!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘wordpress link problem’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 2 participants
 * Last reply from: [James Huff](https://wordpress.org/support/users/macmanx/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/wordpress-link-problem-1/#post-7358786)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
