WordPress.org

Ready to get started?Download WordPress

Forums

Permalinks and Relative Links (9 posts)

  1. Lorelle
    Member
    Posted 9 years ago #

    I was thrilled to discover permalinks and to implement them, though I'm still tweaking them to get what I "really want", but I found a problem with the fixed links I have included in my index.php.

    Absolute links such as:

    "http://www.sitename.com/fred.html"

    work fine, but relative links like

    ../fred/fred.html

    get slapped with the permalink function and I end up with a 404 page not found error at it forces it to

    wordpress/category/fred/fred.html

    instead of

    sitename.com/fred/fred.html

    Any fixing or only changing the relative links to absolute?

  2. Lorelle
    Member
    Posted 9 years ago #

    Also, while I'm on this linking subject, I'm having a strange thing happen with links to images and fixed pages within my Admin/Write page.

    If I set the image location to

    ../images/fred.jpg

    I can see it in the Preview screen fine - a pretty picture. But when I post, the picture isn't found and the famous X box shows up. If I code the graphic

    ../../images/fred.jpg

    I can't see the graphic in my Preview, but it's there on the page for all to see when posted.

    Do I have a strange set up or is this normal? This business of relative vs absolute links gets confusing when you have to do two different things.

  3. wshi88
    Member
    Posted 9 years ago #

    how about reference from the root?

    "/fred/fred.html"

    no need to put http part.

  4. e-head
    Member
    Posted 9 years ago #

    How the heck did you get relative links to begin with ?

    I hacked and fiddled forever trying to get relative links. Don't tell me this is an option somewhere in the admin pages ? Or perhaps a new 1.3 feature ?

  5. Lorelle
    Member
    Posted 9 years ago #

    Anywhere in a post you put a link to something else within your site can be relative. Nothing tricky on this.

    I'll try the reference from the root and see if that works.

    I'm still having troubles with the strange link differences between the link reference in the post preview and the actual site.

    Anyone got any ideas on this?

  6. Lorelle
    Member
    Posted 9 years ago #

    I am still having troubles with relative links.

    I tried the root method:

    "/wp-photos/graphic.jpg"

    And it doesn't work for me. I have permalinks installed. What does work is the non-root, descending method:

    "wp-photos/graphic.jpg"

    BUT only on the index.php page. When I click on the specific page, the photograph isn't found.

    I know I can do a ReWrite in the .htaccess file but I want to get this working for others without having to mess around a lot with the programming.

  7. Mark (podz)
    Support Maven
    Posted 9 years ago #

    It's base url, it goes in head and I'm trying to find the posts....

  8. Mark (podz)
    Support Maven
    Posted 9 years ago #

  9. Lorelle
    Member
    Posted 9 years ago #

    Thanks, podz. I posted a note on there to make sure I've placed the code in the right place. The instructions weren't very clear.

    Also, answer either there or here, would it be the same place in 1.5?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.