Self-Evident / OneFileCMS

A single file cms - all in one file!
http://onefilecms.com/
165 stars 57 forks source link

[ERROR] 404 not found ? #27

Closed sidhi closed 8 years ago

sidhi commented 10 years ago

I got an url, like http://www.test.com And the files located at 'public_html/files/'

When I try to view an image / download a file it, why it always 404 not found cause... because it always goes to 'http://www.test.com' not 'http://www.test.com/files'

I made some change to : $DOC_ROOT = $_SERVER['DOCUMENT_ROOT'].'/files/'; //root folder of website. ... $ONESCRIPT = URLencode_path($_SERVER['SCRIPT_NAME']); //Used for URL's $WEB_ROOT = basename($DOC_ROOT).'/'; //Used only for screen output - Non-url use. $WEBSITE = $_SERVER['HTTP_HOST'].'/files/';

But still the same.... It always goes to 'http://www.test.com' not 'http://www.test.com/files'

How to make it goes to 'http://www.test.com/files' ?

PS : Currently, to make it work, I modify the lines below : class="h2_filename" href="/'.URLencode_path($filename).'" target="blank" title="'.$['Open_View'].'" become class="h2_filename" href="/files/'.URLencode_path($filename).'" target="blank" title="'.$['Open_View'].'"

ir-g commented 10 years ago

Ok, this seems to be a problem linked to the web folder not being a config option. OFCMS was designed for editing the root public_html/www folder and contents, thus a fix hasn't been produced.

Self-Evident commented 10 years ago

Hello, I apologize for the delayed response. (I've been away from this for a while.)

As indicated by isaacrg, OFCMS is designed to work only within the a website's public facing, URL accessible (relatively speaking), directory structure. However, "http://www.test.com/files" should be part of such a directory structure, unless there are redirects or the like going on "behind the scenes".

If you're still using OneFile & experiencing the issue, is the "files" folder outside of the website's root folder? Because I don't understand why you'd have to append anything to $SERVER['DOCUMENTROOT'] (but, I am not php guru either...).

Thanks for taking the time to post your issue, and for any additional info you may be able to provide to help me understand & correct the problem.