Results 1 to 15 of 15

Odd CMS attachment behaviour - not loading under some browsers

This is a discussion on Odd CMS attachment behaviour - not loading under some browsers within the General Discussion forums, part of the vBSEO SEO Plugin category; As the title suggests I am seeing an odd issue with CMS attachments, I am not entirely convinced that this ...

  1. #1
    Senior Member
    Real Name
    mreyes
    Join Date
    May 2008
    Posts
    125
    Liked
    3 times

    Odd CMS attachment behaviour - not loading under some browsers

    As the title suggests I am seeing an odd issue with CMS attachments, I am not entirely convinced that this is an issue with VBSEO however it is definately and issue with hooks/plugins/rewrites so it seemed sensible to post here while I continue to investigate.

    In summary, when a user visit the CMS section listings / homepage or article the included attachment images are not shown. As an example I have a section page that includes the following attachment img markup:

    Code:
    <img class="cms_article_preview_image" src="http://www.mysite.com/attachment.php?attachmentid=13431&amp;cid=18" alt="Article Preview" /></a>
    If I enter the image URL into a browser the request hangs. Now this is where is gets odd, when I say browser I mean Internet Explorer as the URL works fine under Firefox. Under firefox the image is displayed and the image URL is rewritten to:

    Code:
    http://www.mysite.com/content/attachments/13431-dummy.jpg.html
    If I enter the rewritten URL into Internet Explorer the image is displayed correctly.

    As a test, I can disable hooks via query string parameters - so if I enter the following URL into Internet Explorer the image is displayed correct and not rewritten

    Code:
    http://www.mysite.com/attachment.php?attachmentid=13431&amp;cid=18&nohooks=true
    Notice the "nohooks=true" this effectively sets the following:

    Code:
    define('DISABLE_HOOKS', true);
    So there you have it, the problem lies with a combination of some hook and Internet Explorer. Does anybody have any ideas what this might be?

    My current setup is VB 4.0.6 & VBSEO 3.5.1 PL1. I am also using all the default VBSEO CMS settings, it is hard enough trying to get the CMS to work as a decent CMS - so I haven't even looked at the VBSEO CMS settings until this issue came to light.

  2. #2
    vBSEO.com Webmaster Mert Gökçeimam's Avatar
    Real Name
    Lizard King
    Join Date
    Oct 2005
    Location
    Istanbul, Turkey, Turkey
    Posts
    23,100
    Liked
    622 times
    Blog Entries
    4
    Please make sure you are using latest vBSEO 3.5.1 PL1 version and you have CMS attachment rewrite rules enabled.
    Mert Gökçeimam / Crawlability Inc.

    vBSEO 3.6.0 Alpha Önizlemesi - Including Like Tree
    Unveiling the NEW vBSEO Sitemap Generator 3.0 - available NOW for vBSEO Customers!


    Twitter:@Depkac
    Personal Blog : Mert Gökçeimam

  3. #3
    Senior Member
    Real Name
    mreyes
    Join Date
    May 2008
    Posts
    125
    Liked
    3 times
    Quote Originally Posted by Mert Gökçeimam View Post
    Please make sure you are using latest vBSEO 3.5.1 PL1 version and you have CMS attachment rewrite rules enabled.
    As per above I am using 3.5.1 PL1 on vBulletin 4.0.6

    I am also using the default CMS settings:

    ACP -> vbSEO -> Control Panel -> URL Rewrite Settings -> CMS URLs:
    Basic Settings
    • Current Preset: 001 - Hierarchic .html type URLs with content relevant forums and threads (Default Settings)

    Advanced Settings
    • Rewrite CMS URLs? Yes
    • Define Custom CMS Domain? Blank
    • CMS Home: content/
    • CMS Section : Custom -> content/section/[section_id]-[section_title].html
    • CMS Section Articles List : Custom -> content/section/[section_id]-[section_title]-list.html
    • CMS Section Articles List Pagination : Custom -> content/section/[section_id]-[section_title]-page[page].html
    • CMS Category : Custom -> content/category/[category_id]-[category_title].html
    • CMS Category Pagination : Custom -> content/category/[category_id]-[category_title]-page[page].html
    • CMS Author : Custom -> content/author/[user_name]-[user_id].html
    • CMS Author Pagination : Custom -> content/author/[user_name]-[user_id]-[page].html
    • CMS Entry : content/[entry_id]-[entry_title].html
    • CMS Entry Pagination : content/[entry_id]-[entry_title]-page[page].html
    • CMS Entry Comments Pagination : content/[entry_id]-[entry_title]-comments[page].html
    • CMS Attachment : Custom -> content/attachments/[attachment_id]-[original_filename].html

  4. #4
    vBSEO.com Webmaster Mert Gökçeimam's Avatar
    Real Name
    Lizard King
    Join Date
    Oct 2005
    Location
    Istanbul, Turkey, Turkey
    Posts
    23,100
    Liked
    622 times
    Blog Entries
    4
    You don't have your regular vBulletin attachment rewrites enabled. In order to get attachments working correct on CMS , you should either disable CMS attachment rewrites or enable forum attachment rewrites.
    Mert Gökçeimam / Crawlability Inc.

    vBSEO 3.6.0 Alpha Önizlemesi - Including Like Tree
    Unveiling the NEW vBSEO Sitemap Generator 3.0 - available NOW for vBSEO Customers!


    Twitter:@Depkac
    Personal Blog : Mert Gökçeimam

  5. #5
    Senior Member
    Real Name
    mreyes
    Join Date
    May 2008
    Posts
    125
    Liked
    3 times
    Quote Originally Posted by Mert Gökçeimam View Post
    You don't have your regular vBulletin attachment rewrites enabled.
    Indeed, I didn't realise the two were linked.

    Running the risk of sounding really stupid how would I disable attachment rewrites for the CMS? I don't seem to be able to find and option for it without switching off all CMS rewrites with the "Rewrite CMS URLs" option

  6. #6
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    657 times
    Blog Entries
    2
    There is a known bug in the current build. Even with the cms rules disabled, attachments are still re-written. This will be fixed in 3.5.2.

  7. #7
    Junior Member
    Real Name
    Mooff
    Join Date
    Jul 2008
    Posts
    7
    Liked
    0 times
    Just wanted to let you know. We ran into this problem today using 3.6.0.
    We do not want attachments to be rewritten. Unfortunally cms attachment rewrite seems to be always active. We 'solved' the issue by using 'attachment.php/attachmentid=[attachmentid]' as rewrite rule.

  8. #8
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    657 times
    Blog Entries
    2
    attachments are a global setting (both forum and cms run the same attachment.php script).

  9. #9
    TnT
    TnT is offline
    Junior Member
    Real Name
    Thomas Trautner
    Join Date
    Nov 2005
    Location
    Germany
    Posts
    20
    Liked
    0 times
    Hi,

    I have simmilar problem here with attachments in cms:

    Attachment rewrite enabled, i get this urls and a 404 not found:

    http://domain.com/content/attachment...538.png?cid=24


    with attachment rewrite disabled, i get this urls:

    http://domain.com/attachment.php?attachmentid=17&cid=24

    the script hangs several seconds, tries to redirect to

    http://domain.com/content/attachments/17-37258.jpg

    redirect fails, 404


    when i disable vbseo, i get this urls:

    http://domain.com/attachment.php?attachmentid=17&cid=24

    Attachments work and shown immediately.

  10. #10
    TnT
    TnT is offline
    Junior Member
    Real Name
    Thomas Trautner
    Join Date
    Nov 2005
    Location
    Germany
    Posts
    20
    Liked
    0 times
    VBulletin: 4.1.4 Patch Level 2
    vBSEO: 3.6.0

  11. #11
    Junior Member
    Real Name
    Mooff
    Join Date
    Jul 2008
    Posts
    7
    Liked
    0 times
    Quote Originally Posted by Brian Cummiskey View Post
    attachments are a global setting (both forum and cms run the same attachment.php script).
    In theory.

    In practice even though they are off in our forum it still does try to rewrite the cms ones.

    Links are the same for forum and cms, let's say this is my forum attachment:
    mysite.de/attachment.php?attachmentid=101
    -> it will load fine

    and this one is linked to an article (link isn't different, only difference is the contenttypeid in the database)
    mysite.de/attachment.php?attachmentid=102
    -> it won't load - and our varnsih/nginx logs show that the url was rewritten by seo

  12. #12
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,741
    Liked
    168 times
    Please try to modify functions_vbseo_hook.php file:
    find:
    if(THIS_SCRIPT == 'attachment')

    replace with:
    if(VBSEO_REWRITE_ATTACHMENTS && (THIS_SCRIPT == 'attachment'))

  13. #13
    TnT
    TnT is offline
    Junior Member
    Real Name
    Thomas Trautner
    Join Date
    Nov 2005
    Location
    Germany
    Posts
    20
    Liked
    0 times
    Hi Oleg,

    thanks, seems to work for me.

    I have disabled before your suggest complete attachment rewrite while commenting out Line 270.

  14. #14
    Junior Member
    Real Name
    Fenriz
    Join Date
    Oct 2006
    Location
    Norway
    Posts
    24
    Liked
    3 times
    Hi Oleg, your modification solved a really annoying bug with a photo-attachments under nginx+php-fpm. Could you include the mod in a future vbseo release?

  15. #15
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,741
    Liked
    168 times
    Sure, it will be included in main vBSEO code as well.

Similar Threads

  1. Site wide URL rewrite - how to clear browsers cache of visitors
    By imedic in forum Custom Rewrite Rules
    Replies: 3
    Last Post: 10-19-2009, 11:46 PM
  2. Acronym in a browsers title
    By dimas in forum Troubleshooting
    Replies: 2
    Last Post: 04-16-2009, 01:42 PM
  3. More strange behaviour...
    By Sonnie in forum Troubleshooting
    Replies: 3
    Last Post: 09-08-2006, 11:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •