Jump to content
MakeWebGames

Recommended Posts

Posted

Well i choose the main 5 error the clients and we ourseleves see: 400, 403, 404, 500 and 505.

Add this into your .htaccess

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

and create a file called errors.php and place the following in:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Posted

Re: [MC Code V2] Custom Error Pages

nice go, yet i hate the damn <meta> forwarding.

try this :)

time_sleep_until(time()+0.5);

header('Location: login.php');

instead the

<META HTTP-EQUIV=Refresh CONTENT="5;url=login.php">

Note: you can't test it under windows machines unless you already have PHP 5.3 (can be get on the daily CVS)

Posted

Re: [MC Code V2] Custom Error Pages

Why when you could add at the top ob_start();

Then header("Location: index.php");

Why send them to index.php? to check if there loggedin! if not it will send them to login.php page!

Posted

Re: [MC Code V2] Custom Error Pages

 

nice go, yet i hate the damn <meta> forwarding.

try this :)

time_sleep_until(time()+0.5);

header('Location: login.php');

instead the

<META HTTP-EQUIV=Refresh CONTENT="5;url=login.php">

Note: you can't test it under windows machines unless you already have PHP 5.3 (can be get on the daily CVS)

Dosen't work :wink: takes me straight to login.

 

Why when you could add at the top ob_start();

Then header("Location: index.php");

Why send them to index.php? to check if there loggedin! if not it will send them to login.php page!

They won't see the menu.. and anyway if they not logged in globals.php have already a function to kick them to login if they aren't loggedin. I have aleady thought od numerous idea's and suggestions. My way is good enough and will be good enough to everyone else.

 

Crazy-T, the header("location"); will automaticly direct them to a page without them seeing the page.

And thanks Killah to state that obvious point.

Posted

Re: [MC Code V2] Custom Error Pages

 

Dosen't work :wink:

 

When you say doesn't work... on windows machines... it does not as i told!

Other than that, take Crazy_T suggestion and add the ob_start(); on top and it would work without giving the "headers already sent" error message

:)

Posted

Re: [MC Code V2] Custom Error Pages

Note: you can't test it under windows machines unless you already have PHP 5.3 (can be get on the daily CVS)

 

i am using windows so i can't test it unless i have PHP 5.3, which i do on my WAMP server..

Posted

Re: [MC Code V2] Custom Error Pages

 

Yeah same if like someone is voting on a site like

You are voting at C.E topwebgames redirecting in 3 seconds

But you know, all the above codes do exactly the same. so its just a matter of preference on what to use ;)

Posted

Re: [MC Code V2] Custom Error Pages

 

Yeah same if like someone is voting on a site like

You are voting at C.E topwebgames redirecting in 3 seconds

But you know, all the above codes do exactly the same. so its just a matter of preference on what to use ;)

Not entirely true, then will all do the same job however. The php version will do it when the page is processed, Whereas the HTML will be a client side refresh and will happen when the page is cached.

The page shouldn't be frereshed, the user should know what is wrong. Also with 404 you should get the game layout...

Posted

Re: [MC Code V2] Custom Error Pages

 

Not entirely true, then will all do the same job however. The php version will do it when the page is processed, Whereas the HTML will be a client side refresh and will happen when the page is cached.

The page shouldn't be frereshed, the user should know what is wrong. Also with 404 you should get the game layout...

Quite true indeed, so my post should've been... final result will be the same ;)

Posted

Re: [MC Code V2] Custom Error Pages

Y should i use this, what benefits does it have?

does it hide Like query errors so users/owner dont see them or is it when its an Invalid use of file?

can something like that be done on folders in directory for example "/images" redirect to (login.php) or any other page

Posted

Re: [MC Code V2] Custom Error Pages

 

Y should i use this, what benefits does it have?

does it hide Like query errors so users/owner dont see them or is it when its an Invalid use of file?

can something like that be done on folders in directory for example "/images" redirect to (login.php) or any other page

Have you ever seen broken links where it says "404 page not found" or something? This will allow you to add custom error pages instead of that

Also, there isn't much sense in redirecting an image. You can however block images being used not on your website, check this out..

RewriteEngine on

RewriteCond %{HTTP_REFERER}!^$

RewriteCond %{HTTP_REFERER}!^http://(www\.)?YOURDOMAIN.com/.*$ [NC]

RewriteRule .*\.(jpg?jpeg?gif?png?bmp)$ - [F]

Posted

Re: [MC Code V2] Custom Error Pages

 

Y should i use this, what benefits does it have?

does it hide Like query errors so users/owner dont see them or is it when its an Invalid use of file?

can something like that be done on folders in directory for example "/images" redirect to (login.php) or any other page

Have you ever seen broken links where it says "404 page not found" or something? This will allow you to add custom error pages instead of that

Also, there isn't much sense in redirecting an image. You can however block images being used not on your website, check this out..

RewriteEngine on

RewriteCond %{HTTP_REFERER}!^$

RewriteCond %{HTTP_REFERER}!^http://(www\.)?YOURDOMAIN.com/.*$ [NC]

RewriteRule .*\.(jpg?jpeg?gif?png?bmp)$ - [F]

Just a small update on POG1's lines.

RewriteRule .*\.(jpe?g|gif|png|bmp)$ - [F]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...