So i have tried to generate URL for few folders (public and private) in the file manager and i open that link, it shows the files in that folder which is great but then it redirects the URL to 404 page..
Any ideas ??
Adam, any suggestions on how i can have my 404 page and still view folders using URL ?
Basically what its doing is, i will open a URL for the public folder and i see the webpage for about a second and then it redirects to 404 error page. I dont know why (!file) function is getting executed....
Adam, Thanks for looking into this. I have sent you a PM on this forum with a link to the video.
Whats shown in the video is what happens when i have this 404 page line in the code.
coreFunctions::redirect(coreFunctions::getCoreSitePath() . "/404." . SITE_CONFIG_PAGE_EXTENSION);
If i remove the 404.html code line and only have "coreFunctions:utput404();" in the code, the folder view works fine and it does not redirect me to 404 which is good but the problem is when there is an actual 404, it shows me a blank page which i dont want, i want the users to see a 404 page in case of real error.
Can we have this looked at please?
I believe the 404 code is checking for no file exist. (!$file). If there a way to add a OR command in this line to check for Folders as well ? I want to have this ability to share folders on my site but i am unable to do so.
Adam, yes you did look into that.
If you give me FTP access to your demo, i can reproduce it.
All i changed was in case of 404 error, show a 404.html page instead of blank page and the folder URLs started redirecting to 404.html page.
If you want to make that change in your dev site and try it out ?
What i figured is that you have if (!$file) then show 404. This will need to be changed so there is a OR statement that if a user is viewing a folder, dont redirect unless there is no such folder available.
For your 404 on folders, you have the script to redirect to homepage instead of 404 or blank page..
yes, the URLs are of this type and the 404 error page change was made in file_download.php
and i believe i have a fix for it now, so what i did was i created another if statement in the !file to check if the URL had the word folder in it and if it did, to not redirect to 404 page and that seems to be working....
The only thing left is to redirect users to 404 if folder doesnt exist. This still redirects them to homepage instead of 404 page.