GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   How can URL be blocked even before loading? (https://gfy.com/showthread.php?t=1363604)

Klen 04-05-2023 04:36 AM

How can URL be blocked even before loading?
 
Some CPA networks are blocking access to URL if you dont have right GEO, but URL is not loading at all, meaning you click go and nothing happens. If you would for example, block geo on firewall level, then URL would be throw timeout error after some time. Or if you would put geo block on PHP level you could throw an 403 error. I guess this must javascript thing, but i find it silly to block on pre-load instead redirecting incorrect traffic to somewhere else.

redwhiteandblue 04-05-2023 05:02 AM

What headers are being received?

Klen 04-05-2023 05:08 AM

Quote:

Originally Posted by redwhiteandblue (Post 23120046)
What headers are being received?

First normal 302 and then this:
GET: HTTP/2.0 204 No Content
server: nginx
date: Wed, 05 Apr 2023 12:06:44 GMT
accept-ch: Sec-Ch-Ua-Platform-Version
vary: Origin
x-eflow-request-id: 25d25269-4bc8-4472-bb89-c94cb7049112
via: 1.1 google
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
X-Firefox-Spdy: h2
---------------------

redwhiteandblue 04-05-2023 05:17 AM

So I guess if the server sends the 204 code then the browser just does nothing when it sees it and that's why nothing happens but it's not considered an error.

Klen 04-05-2023 05:18 AM

Quote:

Originally Posted by redwhiteandblue (Post 23120051)
So I guess if the server sends the 204 code then the browser just does nothing when it sees it and that's why nothing happens but it's not considered an error.

Yeah, kind a self-explanatory :upsidedow But i am just used to see either redirect or error message so find it to be weird policy.

Kittens 04-05-2023 07:29 AM

Quote:

Originally Posted by Klen (Post 23120052)
Yeah, kind a self-explanatory :upsidedow But i am just used to see either redirect or error message so find it to be weird policy.

204 is to tell the browser that the request was successful but no content is sent back so no need to parse the body... Usually used in API's and non-GET methods... What URL are you trying hit that gives you that?

ladida 04-05-2023 10:19 AM

Lol this guy knows nothing about how internet works :)
Javascript :))))))

brassmonkey 04-05-2023 10:19 AM

they don't waste time anymore. they just turn off the lights. someone i know was talking about that early this morning

fuzebox 04-05-2023 10:29 AM

There's a lot of reasons why a network or offer would just drop the clicks. Could be a liability of showing content in certain geos, could be for privacy, could be an over zealous fraud protection.

Most companies do not want to redirect other geos to a competitor for whatever reason either. 99% of affiliates that make sales aren't just sending unfiltered untargeted traffic so it should not be a big deal in most cases.

Klen 04-05-2023 11:46 AM

Quote:

Originally Posted by Kittens (Post 23120109)
204 is to tell the browser that the request was successful but no content is sent back so no need to parse the body... Usually used in API's and non-GET methods... What URL are you trying hit that gives you that?

It's a CPA network offer which allows only US traffic. But anyway, i figured out how it's done in PHP:

PHP Code:

<?php
ob_start
();

header("HTTP/1.1 204 NO CONTENT");

header("Cache-Control: no-cache, no-store, must-revalidate"); // HTTP 1.1.
header("Pragma: no-cache"); // HTTP 1.0.
header("Expires: 0"); // Proxies.

ob_end_flush(); //now the headers are sent



?>

Produces same effect.

Klen 04-05-2023 11:50 AM

Quote:

Originally Posted by ladida (Post 23120162)
Lol this guy knows nothing about how internet works :)
Javascript :))))))

I actually know better then how internet works then most of people, but in order to proper debug you need to start with silly questions in order to rule out invalid things.My first guess was javascript because nothing happens in browser, like i did not clicked go at all, and i associate javascript with browser manipulation. And i never seen this 204 status code in action before, only 401,403,404,500,301 and 302.

Kittens 04-05-2023 12:29 PM

Quote:

Originally Posted by Klen (Post 23120197)
It's a CPA network offer which allows only US traffic. But anyway, i figured out how it's done in PHP:

PHP Code:

<?php
ob_start
();

header("HTTP/1.1 204 NO CONTENT");

header("Cache-Control: no-cache, no-store, must-revalidate"); // HTTP 1.1.
header("Pragma: no-cache"); // HTTP 1.0.
header("Expires: 0"); // Proxies.

ob_end_flush(); //now the headers are sent



?>

Produces same effect.

Been almost a decade since I wrote PHP, but AFAIK this should suffice.

PHP Code:

<?php
http_response_code
(204);
?>


Klen 04-05-2023 12:48 PM

Quote:

Originally Posted by Kittens (Post 23120214)
Been almost a decade since I wrote PHP, but AFAIK this should suffice.

PHP Code:

<?php
http_response_code
(204);
?>


Nice, love it when i can shorten code.

brassmonkey 04-05-2023 01:27 PM

ahhh you are trying to duplicate it? the code place would have given you good answers.

pornmasta 04-05-2023 02:00 PM

Htaccess ?


All times are GMT -7. The time now is 04:09 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc