Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

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

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

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


Go to End


4 Posts   1706 Views

Avatar
HansR

Community Member, 141 Posts

6 June 2008 at 11:15am

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

Avatar
HansR

Community Member, 141 Posts

11 June 2008 at 12:03am

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

Avatar
HansR

Community Member, 141 Posts

24 June 2008 at 1:06am

Edited: 24/06/2008 3:31am

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

Avatar
HansR

Community Member, 141 Posts

8 July 2008 at 1:47pm

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