WordPress.org

Ready to get started?Download WordPress

Forums

Relative URL Links in Pages (3 posts)

  1. mireland
    Member
    Posted 8 years ago #

    [I'm using WordPress 2.0.1]

    I'm trying to add links into my static pages. I want to link to other pages on my WordPress site and have the links as relative URLs. Every time I enter a relative link on a Page though, the Page Editor converts it to an absolute one! This can be solved by switching to the plain editor (rather than the rich one) but I don't want to do that.

    The reason I want relative URLs, is that the theme I'm creating needs to be generic/portable i.e. work for multiple similar websites.

    I'm also not sure what the correct form should be for a relative URL on a Page - how do I get the stub of it? e.g. if I have 2 blogs on my webserver: myserver/blogs/blog1 and myserver/blogs/blog2, how do I find out which one I'm on dynamically?

    Alternatively, if I can find out the webserver name dynamically, then I don't need relative URLS. I'm having trouble doing this with php in a Page though, as I'm getting character translation issues and it isn't a user-friendly way of specifying links either.

    Thanks for any help...

    Mark

  2. outofbounds
    Member
    Posted 7 years ago #

    mark; did u ever get this resolved? i have exactly the same issue.

    thanks

    jay

  3. VeloSteve
    Member
    Posted 7 years ago #

    Back when I was in the web software business, it was a bug to use an absolute link when a relative one would do.

    Relative links work when sites are moved, or (my current problem) when testing a site with a temporary address before a hosting change.

    Is there a way to turn off this auto-mangling?

    p.s. So far I am very happy with my move to bluehost.com, which I found through the WordPress site.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags