Forums

[resolved] Absolute path to image on theme folder redirect to 404 (7 posts)

  1. stode
    Member
    Posted 5 months ago #

    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%/

  2. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 5 months ago #

    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?

  3. stode
    Member
    Posted 5 months ago #

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

  4. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 5 months ago #

    What path is it spittnig out on the webpage?

  5. stode
    Member
    Posted 5 months ago #

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

  6. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 5 months ago #

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

  7. stode
    Member
    Posted 1 month ago #

    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.

Reply

You must log in to post.

About this Topic