WordPress.org

Ready to get started?Download WordPress

Forums

custom links - remove the http? (6 posts)

  1. TimTee
    Member
    Posted 3 years ago #

    I'm using a custom menu set to primary, in order to link to other non wordpress pages on the same server. It works, but I am forced to use a full url with http, I erase it, and it inserts it again (so the link doesn't work of course).

    any way to prevent it from doing this?
    thanks!

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    Not that I know, Generally speaking, WordPress simply doesn't generate relative urls - only full ones. What's the problem with using full urls?

  3. TimTee
    Member
    Posted 3 years ago #

    thanks, though these aren't generated, ones I enter as a custom link. It adds it.

    It isn't that it doesn't work, but generally when I build a site with menu items to pages within the site, I don't use fully qualified urls for all menu items so it seemed odd this isn't an option.
    thanks!

  4. esmi
    Forum Moderator
    Posted 3 years ago #

    When using WordPress, you really have to get used to using full urls. Because it uses generated content dynamically from a database via a templating system, using relative urls will produce very unpredictable results.

  5. franclin
    Member
    Posted 2 years ago #

    I'm working locally and it would be great to have relative links for some of my "custom links".

    Currently I have to manually change all my custom links to ensure they don't point to the local drive when I go live.

    ie. change the link from locall888/mylocalsite/page to http://www.mysite.com/page.

    It's a small pain but a pain that could easily be avoided with a relative link. : (

  6. regneel
    Member
    Posted 2 years ago #

    It's possible to provide a relative url on custom menus
    Enter your url as "/relative_url" and it'll go to http://www.domain.com/relative_url

Topic Closed

This topic has been closed to new replies.

About this Topic