Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Clicking on the uploads directory in Files & Images gives a 404 page not found error

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 1387 Views
  • HansR
    Avatar
    Community Member
    140 Posts

    Clicking on the uploads directory in Files & Images gives a 404 page not found error Link to this post

    Amongst a few other problems that I'm having, some of the admin pages are giving me 404 page not found errors. For example, clicking on uploads (or the main site right above it) causes this. The server log says:
    [05/Jun/2008:18:56:59 -0400] "POST /admin/comments/showtable/unmoderated&ajax=1 HTTP/1.1" 404
    (with the irrelevant bits removed)

    Other pages that do this are:
    - clicking on the uploads tab in Files & images
    - Clicking on "awaiting moderation" in the comments page (or any other item in the list on the left side of the page

    Any ideas on what is causing this? I've searched through the forums here but haven't found any solutions.

    Hans

  • HansR
    Avatar
    Community Member
    140 Posts

    Re: Clicking on the uploads directory in Files & Images gives a 404 page not found error Link to this post

    Just letting you all know that I finally figured out what was causing the problem. The Silverstripe CMS' main entry file, sapphire/main.php, has the following in line 149:
    $baseURL = dirname(dirname($_SERVER['SCRIPT_NAME']));

    On the server that I'm using, this is supposed to return "/", because that is the base at which I installed the CMS. However, with longer URLs, (e.g., sub-pages within security, assets, comments and blog links such as tags and archives), it appends the base directory of that page to $BaseURL. For example, the URL "blog/tags/Google" will set $baseURL to "/blog" instead of "/". As a result, it fails to find the appropriate files, and returns an error.

    I have hard-voded $baseURL = '/'; for now.

    BTW, the provider that I'm using is kiwihosting.org.nz. I'll add them to the list of providers that Silverstripe can be installed on, with instructions on how to do it, later.

    Hans

  • HansR
    Avatar
    Community Member
    140 Posts

    Re: Clicking on the uploads directory in Files & Images gives a 404 page not found error Link to this post

    There are some additional problems. *Sigh*

    The upload images section still wasn't working. For some reason, Silverstripe would prepend admin/assets/ to the submit URLs (amongst others), resulting once again in 404 errors. A URL might end up looking like:
    admin/assets/admin/assets/upload/submit/

    If anyone has any idea as to why, please let me know. For now, I've added the following rules to the .htaccess file:
    RewriteRule (.*)/sapphire/(.*) /sapphire/$2 [L]
    RewriteRule (.*)/jsparty/(.*) /jsparty/$2 [L]
    RewriteRule (.*)/cms/(.*) /cms/$2 [L]
    RewriteRule /admin/assets/admin/assets/(.*) /admin/assets/$1 [L]

    I might need to add one or two more, as I also get the odd page-save error too.

    Hans

  • HansR
    Avatar
    Community Member
    140 Posts

    Re: Clicking on the uploads directory in Files & Images gives a 404 page not found error Link to this post

    I've solved tha last few problems, and posted installation instructions here.

    1387 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.