XFileSharing Pro - 404 page

Message
Author
hdshare
Posts: 7
Joined: Nov 14, 2010 3:48 am

404 page

#1 Postby hdshare » Nov 19, 2010 3:00 pm

Haw can I add 404.html page?

I know that there is a 404 page, but most of websites owners where I post my links do not allow my site because there is no 404.html in url.

This is exactly what I mean: http://........com/404.html

I have contacted support regarding this matter, but wouldn't reply.
Last edited by hdshare on Nov 19, 2010 5:44 pm, edited 2 times in total.

komi
Posts: 161
Joined: Nov 27, 2009 12:41 pm

#2 Postby komi » Nov 19, 2010 3:07 pm

The last version of XFS contains a default 404 page. No matter what you type, if the URL doesn't exist, it will return the 404 page.

It also seems to work correctly on your site, so not sure what you mean here.

PowerChaos
Posts: 521
Joined: Dec 19, 2009 5:12 pm

#3 Postby PowerChaos » Nov 19, 2010 3:52 pm

use this code if you want to rewrite the 404 error to a file (browser side) instead the 404 page (server side)

Code: Select all

RewriteEngine On
Options +FollowSymlinks

RewriteBase /

RewriteCond %{REQUEST_URI} !-d
RewriteCond %{REQUEST_URI} !-f
RewriteRule ^(.*)$ /404.php [L]
add the code to your htacces file

Code: Select all

RewriteCond %{REQUEST_URI} !-d
if the requested url is not a directory , rewrite

Code: Select all

RewriteCond %{REQUEST_URI} !-f
if the requested url is not a file , rewrite

Code: Select all

RewriteRule ^(.*)$ /404.php [L]
where to rewrite it to ??

hopely this can help you

Greetings From PowerChaos

hdshare
Posts: 7
Joined: Nov 14, 2010 3:48 am

#4 Postby hdshare » Nov 19, 2010 6:57 pm

Thanks mate, but your code doesn't work at all. I don't know, maybe I'm doing something wrong, but when I use your code the whole site goes down. :(

PowerChaos
Posts: 521
Joined: Dec 19, 2009 5:12 pm

#5 Postby PowerChaos » Nov 20, 2010 1:21 am

seems that the 404 get generated with api.cgi

make backups before starting to edit this file (can go badly wrong :S)

open that file (api.cgi) and search for

Code: Select all

$conf=~s/ErrorDocument 404 .+/"ErrorDocument 404 $cc->{site_url}\/404.html"/e;
and you will see this code below to

Code: Select all

print FILE qq[RewriteEngine on\nRewriteCond %{REMOTE_ADDR} !^$ip\nRewriteRule ^.*\$ "$c->{site_url}/404.html?$c->{site_url}/$f->{file_code1}/$file_name.html"];
i am not sure what to put in there , but those 2 are generating your htacces file + error 404 redirection

if you can alter it a bit and make it go to your url instead , then that would solve your problem , but i wont suggest to start messing with it if you are not sure ( or spend some time with it to learn it )

i am not able to help you with that as i know nothing of cgi (i just mess around and learn with messing around .. best way to learn :D )

but like komi says , the 404 page is just located on root
in my case is it located here
http://boosterking.com/404.html

hopely this could help you a lot more ??

the other thing you can try (make backup , can do GREAT damage) is to remove that 404 error line and put the code of me in it
so you wont have a dublicated lines (those 404 that get written in it )

anyway , hopely this can help you to find your solution

Greetings From PowerChaos

hdshare
Posts: 7
Joined: Nov 14, 2010 3:48 am

#6 Postby hdshare » Nov 24, 2010 10:27 pm

I'm not going to mess with coding while I'm nt sure what I'm doing, that's why I contanceted support regarding this matter but they wouldn't reply.

Support here is very unprofessional. Getting all that money for script and all the mods you could meka a bit more professional approach to you customers. :(

PowerChaos
Posts: 521
Joined: Dec 19, 2009 5:12 pm

#7 Postby PowerChaos » Nov 24, 2010 10:58 pm

it takes sometimes long to get a reply

but if they reply then you got mostly a solution

sometimes they are fast , other times they are slow , depends on what problem you have

to provide a example

if you got a small error or need a edit solution then they can be slow
but if you got a script that is refusing to work (like torrent mod) then they are not that slow

so it depends what priority it have and for what reason (from own experiance)

to get back ontopic

i would do the same , the other thing you can do (will give a 404 page :D) is fixing the headers and put a 404 not found header in it

on that way it will show you a 404 page with headers instead a normal other webpage

maybe you can get it working on that way instead messing with the script to get it redirected to a differend kind of 404 page when it is basicly the same

Greetings From PowerChaos

hdshare
Posts: 7
Joined: Nov 14, 2010 3:48 am

#8 Postby hdshare » Nov 25, 2010 5:41 pm

I can understan that sometime it can take sometime to reply on the forums, but there is no excuse for not replying on support tickets. That's unprofessional.

To get back on topic ;)

I don't quite understand what you mean by "fixing the headers". How can I fix the headers and put 404 not found?

I case you didn't get what I want, I'll give an axample.

Loombo is one of the bigest sites on the net using the same script, and they had the same problem, most of the site owners where users post links do not allow sharing sites without 404.html page, this is what I mean: http://www.loombo.com/no_file.html

So, can the admin reply to this post, because he's already been dealing with it many times, and he's aware of how importand this is to every user of this script.

PowerChaos
Posts: 521
Joined: Dec 19, 2009 5:12 pm

#9 Postby PowerChaos » Nov 25, 2010 5:56 pm

well , thats a easy solution

you mean like this error page

http://powerchaos.com/showmetheerror

it is realy easy to do that

go to 404.html , open that file

just past your template in it (vieuw source code of your index script)

and you got yourself a build in template


only in your case , put it in no_file.html (cgi folder , template)

then it will remove that link that says , file not found , return back to main page

it is basic html and has nothing to do with htacces
and it is not a 404 error , as it is a simple html page

404 means file not found , but 404 does not reffer back to a file , it get server side loaded

the file not found means that it can not be found back in the database , it is sended by the script to that location and has nothing to do with a 404 error (it is just a file not found page , not a 404 page)

hard to explain , to explain it easy

you want to have a template around the file not found (after invalid DOWNLOAD link) page
or
you want to have a custom 404 error page ? ( non existing url )

so far i saw the example , just copy the source of your template (right click .. ) and put it in there, and change the middle part to File Not Found (and keep 404 error as tittle)

hopely this can help you ??

Greetings From PowerChaos

vb24
Posts: 15
Joined: Nov 25, 2010 6:31 am

#10 Postby vb24 » Jan 15, 2011 5:49 pm

Hi,

i am having the same problem is there an update on this situation

Code: Select all

http://www.vidxden.com/dsewdfdc6uwxv it leads to this one http://www.vidxden.com/404.html, 
not an error on the same page like it is now.

admin
Site Admin
Posts: 1843
Joined: Mar 22, 2006 12:32 pm

#11 Postby admin » Jan 15, 2011 6:14 pm

PowerChaos gave great explanation (see his last reply).
And, please, in future, do no bump old threads.