• I can’t find an answer to this after searching the codex and these posts. I’m baffled.

    On my index page my post titles have links essentially like this:

    <a href="<?php the_permalink() ?>"><?php the_title(); ?></a>

    However, when it generates it on the page it looks like this:

    <a href="https://domain.com//post-title">Post Title</a>

    note the double forward slashes after the domain. This only happens for the post titles on the index.php page – nowhere else (that I have noticed).

    What’s the deal?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Go to WP-Admin > Options > General and remove any trailing slash in the fields: WordPress address (URI) and Blog address (URI)

    i had that too. worked for me.

    example
    somedomain.com/blog/ -> somedomain.com/blog

    (i didnt put https:// cause i dont want to have a link to the example url)

    i think you can follow.
    good luck

    regards, m3nt0r

    Thread Starter slambert

    (@slambert)

    Mentor, I so wanted that to solve the problem, but just I checked and my WordPress and Blog address URI’s look correct… hmmm… In fact I just noticed that if you try to add a slash at the end, WordPress takes it away automatically when you update the settings.

    Any other ideas? I want to get this solved, but I have no clue right now where to approach it from.

    What is your permalink structure? I bet that’s the problem.

    nah, slambert. i didnt add the slash, i removed it. anyways. doesnt look like this was the problem. according to the hint of viper i think the slash is in your permalink structure too. (didnt know you got permalinks active, doh)

    presumably the first one in line.

    regards, m3nt0r

    Thread Starter slambert

    (@slambert)

    My permalink structure is:

    /???%category%/%postname%

    If that offers any clues, let me know. Part of what is so baffling to me is why this is only happening on the index.php page.

    What’s with the question mark? The double slash is coming from the category not being put into the permalink. That’s either due to the question mark or if you’re running Apache v1.x.

    Read this: https://codex.www.ads-software.com/Using_Permalinks

    Specificly this part:

    Note on using %category%
    %category% does not work correctly with some implementations of mod_rewrite in Apache versions prior to 2. If you are using Apache 1 and experience problems with using %category, either do not use %category% in your permalink structure, or refer to Schlueterica’s plugin.

    Thread Starter slambert

    (@slambert)

    Viper, what question mark are you talking about?

    I’m looking into what version of Apache my sever is running. My initial running of the plugin hasn’t worked yet.

    /???%category%/%postname%
      ^ that one

    And you can find out your Apache version via phpinfo(). Go here if you have no clue what I’m talking about: https://codex.www.ads-software.com/Finding_Server_Info

    Thread Starter slambert

    (@slambert)

    Viper, I don’t see a question mark, I see a percentage sign. Is that what you mean?

    I’m running Apache 1.3.27

    I have the plugin running, seems to be installed correctly, but so far it isn’t making a difference. I wrote to the writer, waiting to hear back.

    I’m also talking to my host. When I get a solution I will make sure to post it here.

    Also, for what it’s worth, I’ve noticed that when I have a post in a subcategory, it works fine. Top level categories get the // problem in the link.

    If anyone has any other ideas, please let me know.

    Thread Starter slambert

    (@slambert)

    This turned out to be some weird bug with that particluar version of apache and SQL. My host, a handy and brilliant guy, made a patch on his server. It was way over my head, but I will try to get the details up here eventually.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘the_permalink on index causes // in link’ is closed to new replies.