Forums

Thumnail Permalink Problem - URL to attachment page is wrong. (9 posts)

  1. tluskie
    Member
    Posted 2 years ago #

    I am having trouble when I publish thumbnails using the on board gallery tool. The thumbs show just fine, however they do not link through to the attachment.php page correctly.

    In draft/preview mode, it works perfectly.

    Once it publishes LIVE to the site, the URLS change.

    Example gallery (scroll to the very bottom):

    http://icydk.com/2008/12/08/new-lady-gaga-elle-magazine-scans/

    The thumbnail links do not show the larger image page(attachment.php) when clicked.

    However in draft/preview mode, they click through just fine.

    It looks like the ?attachment_id=XXXX variable is pulling in the file name instead of the correct id number.

    How do I control this and get them pointed in the correct direction?

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Have you tried:

    - deactivating all plugins to see if this resolves the problem? If this works, re-activate the plugins one by one until you find the problematic plugin(s).

    - switching to the default theme to rule out any theme-related problems?

    - resetting the plugins folder by FTP or phpMyAdmin? Sometimes, an apparently inactive plugin can still cause problems.

  3. Shane G.
    Member
    Posted 2 years ago #

    Hi,

    Set your desired permalink and add this code in htaccess:

    # BEGIN WordPress
    
    <IfModule mod_rewrite.c>
    ErrorDocument 404 /index.php?error=404
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    Thanks,

    Shane .

  4. tluskie
    Member
    Posted 2 years ago #

    Hey Shane -

    No luck with that. Any other ideas?

  5. tluskie
    Member
    Posted 2 years ago #

    Update:

    When the gallery tool makes the thumbnail links, it makes them like this:

    http://domain.com/2009/12/08/new-lady-gaga-elle-magazine-scans-2/lg1/

    However, it SHOULD be like this:

    http://domain.com/2009/12/08/new-lady-gaga-elle-magazine-scans-2/attachment/attachment/lg1/

    Once the /attachment/ is added, everything works fine. How do I get it do do that?

  6. tluskie
    Member
    Posted 2 years ago #

    Ohh, and I should add that this site is not on apache. It's nginx.

    Your help is greatly appreciated!

  7. tluskie
    Member
    Posted 2 years ago #

    BUMPY bump

  8. nothingless
    Member
    Posted 2 years ago #

    I'm having the exact same problem. Tluskie, I checked your site and it seems to work ok now? Could you tell me what the problem was for you?

  9. ljmcwilliam
    Member
    Posted 2 years ago #

    I was having this exact same problem. After 3 hours of pain, i finally found it was due to the sCategory Permalink plugin i had installed. When i completely removed this and updated each post, the attachment links corrected themselves. Do you have this plugin installed?
    I found another plugin that allows me to customise my permalinks without causing this issue called Custom Permalinks.

    Hope this solves your problem.

Topic Closed

This topic has been closed to new replies.

About this Topic