• I am using WordPress as a homepage for an internal server. On the links I have it pointing to certain folders inside my Lan such as mrtg/ = should load the mrtg folder. But when adding links in the admin section under links in the URI section it always adds https:// to the link. Where can I remove that at?

Viewing 13 replies - 1 through 13 (of 13 total)
  • Not quite clear about this.

    WordPress cannot just *point* to folders on your Lan. Even on a local network it has to work on a web server. That is to say, it must be installed somewhere under the document root of a web server and must communicate over the http protocol, normally on TCP/IP network.

    So how do you “point to certain folders” ?

    Thread Starter Shelby DeNike

    (@sdenike)

    I have WordPress setup and running on Apache 2.0 … What I am asking is where in the code would I be able to comment out the “https://&#8221; that is being added to links that I create in the “Add Link” section. What I am wanting to do is make so that the links are like so < a href=”mrtg/”>link< /a> instead of it making them like so < a href=”https://mrtg/”>link < /a>

    OK! If I finally understand you right, you want relative URL:s ?

    Both URL:s still confuse me.

    The < a href="mrtg/"> will not work because it lacks the protocol part.

    1. As you are indeed using a web server, the address must contain a domain name. Like so:
    https://mycomputer.mydomain/mrtg/
    ( normal alias for mycomputer is www, but its OK with the computer name known to the local network too )

    2. If both your client ( browser ) and the web server is on the same machine, you can use https://localhost/mrtg in your browsers address field. In calling the web from another machine you must use the machine name or an alias.

    3. If you use relative URL:s for your links, the browser will add the protocol and computer-domain part
    https://mycomputer.mydomain/
    so why do you prefer relative URL:s?

    I am trying to figure out how to remove the https:// in front of links added through the admin panel also. Where in the code is this added?

    WordPress itself automatically adds an https:// at somepoint in the code to your links, if you do not add it yourself. I’ve tried finding it, but thus far can not. Anyone have a clue where it is?

    brett,
    why would you do that?

    He wants to do that because he wants the links to be relative (e.g. “/somepage”) rather than explicit (“https://www.mydomain.com/somepage&#8221;). There are many good reasons someone would want to do this. I’ve also been trying to strip that forced “https://&#8221; so I’ll post here again if I figure it out.

    Relative or absolute, a web url still always starts with “https://&#8221;. If it isn’t prefixed as such, most browsers will assume it for you.

    Even a local lan share has a server name.

    Is the OP trying to browse to local network file shares? (\\servername\sharename)?

    A relative URL lets the client figure out the full path. That’s why you use relative URLs. Who wants to type the whole URL every time? Adding the “https://&#8221; by default assumes that everyone’s always going to be entering an offsite URL, which isn’t the case.

    Not necessarily…. on my local server, the urls still begin with “https://&#8221; – https://localhost/ etc.

    Agreed, relative vs. absolute is more about the path than it is the server. leading “/” to indidate top of the “web root” (absolute), where as a directory without the leading slash indicates it is a sub directory of your current page (i.e. relative).

    Http:// remains the web protocol, regardless of which is used.

    Has anyone figured out how to do this? I use Links to point to various parts of my own site using relative links (with absolute paths). It is of great importance to me for future compatibility that they NOT contain the “https://domainname&#8221;. Internal links should be relative so you can just pick the whole thing up and dump it in a new domain and everything will still work. If I decide to change my domain name one day I DO NOT want to have to edit every internal link in the content to change the domain name, what a headache! All of my external links are obviously absolute urls.

    This was working in previous verions of WP btw, and has only become a problem for me since upgrading.

    I should add that the inability to add relative internal links is not only a potential problem if I change my domain name in the future. It will be a problem every time I want to run a copy of my blog on “https://dev.mydomain.com/&#8221; while upgrading, redesigning, etc and want to test adequately.

    In rereading my comments above, I’d suggest that I was a wee bit off track on my insistence of providing “https://&#8221; in the link. In fact, I should be beaten about the head and shoulders — I use relative urls ALL the time in my blog and should definitely have known better.

    Things like
    <a href="/blog/2005/11/10/music-projects/">other article</a> seem to be safe and portable.

    I apologize to all previous folks in this thread for my misleading statements.

    I have commented out line 483 of admin-functions.php and solved my problem.

    “$_POST[‘link_url’] = preg_match(‘/^(https?|ftps?|mailto|news|gopher):/is’, $_POST[‘link_url’]) ? $_POST[‘link_url’] : ‘https://&#8217; . $_POST[‘link_url’];”

    I hope this is helpful to anyone else wanting to add relative links. I haven’t tested it terribly extensively so be careful. This will also mean it is entirely up to you to make sure you include the https:// (or whatever) in your links if it is actually needed.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Remove HTTP:// From Links’ is closed to new replies.