• Resolved stode

    (@stode)


    This is a weird problem.
    I link to image and it redirects to “404”.
    The path is absolutely right, and I’ve even clicked the image file from directory listing.

    Could there be a conflict with wordpress term/taxonomy/variable names?

    Here is the code where define the path to the image:
    $player_code .= "image: \"".get_template_directory_uri()."/images/netti_tv_kuva.jpg\",\n";

    My permalink structure is following:
    /%postname%/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    get_template_directory_uri() means it’s looking in domain.com/wp-content/themes/themename …

    Is everything else working on your site with that theme?

    Thread Starter stode

    (@stode)

    Yes, that’s the form of the URL and everything else is working too so it really makes crazy in it’s random nature.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    What path is it spittnig out on the webpage?

    Thread Starter stode

    (@stode)

    The path follow this pattern:
    https://domain.com/wp-content/themes/themename/images/netti_tv_kuva.jpg

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    And if you put that in the browser, it works?

    Thread Starter stode

    (@stode)

    That path worked and on another occasion with another file it did not, but the problem is now “solved”, I mean it has not occured anymore. It might have been something temporarily on the server side eg. apache redirect or cache, but hopefully I won’t run in to it in the future.

    Thank you for the responses.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Absolute path to image on theme folder redirect to 404’ is closed to new replies.