mraid.js

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 8
Joined: 06 May 2016, 16:24

mraid.js

12 May 2016, 12:30

Because of third party ads that were not setup correctly, we get a ton of 404 errors generated by calls to an ad script file called mraid.js. From my understanding, the file is actually a script commonly used by ad servers to serve mobile ads. It can be called in any subfolder. For example:
/mraid.js
/blah/mraid.js
/blah/blah/mraid.js

What would be the best rewrite rule to handle this to just ignore the call all together so my web server does not have to process the request?

User avatar
Posts: 402
Joined: 06 Mar 2012, 11:59

Re: mraid.js

12 May 2016, 15:04

Hello.

To make life simple one may say use something like RewriteRule mraid\.js - [F]
However, understanding your real demand, my suggestion would be not to use URL rewriting here. Really, 404s are one of fastest things IIS can do. If you concerning about impact it has on your server, you can use IIS Request Filtering. Use URL request rule in request filtering widget, set it as "mraid.js". Adding layer of URL rewriting will actually put more load on a server, insignificant, but since you are trying to eliminate one of the tiniest load of 404s possible, using URL rewriter cannot be justified.

User avatar
Posts: 92
Joined: 01 Dec 2012, 14:22

Re: mraid.js

12 May 2016, 16:07

The problem can be that Google punish a site for lots of 404s.

One question to ask is why requests to the site are referencing this file? Do you have links anywhere on the site that reference it?

User avatar
Posts: 8
Joined: 06 May 2016, 16:24

Re: mraid.js

12 May 2016, 16:15

RewriteRule mraid\.js - [F]


What does the [F] do?

Would that cover requests to mraid.js in any subfolder? /mraid.js and /blah/mraid.js and /blah/blah/mraid.js?

The reason that the file is getting called is from third party ads that are being displayed through doubleclick on our site, so it's really out of our hands as far as eliminating it at the source. Google wont know about the 404s as google doesn't really call it. But my custom 404.asp script is handling all of the requests, unless the URL structure is in a way that the url rewrite is actually calling another page, and perhaps throwing a 500 error.

I really don't need to give a good server response, I'd like like to intercept the requests to prevent it executing a script.

User avatar
Posts: 402
Joined: 06 Mar 2012, 11:59

Re: mraid.js

12 May 2016, 18:02

The [F] flag stands for 'forbidden' and means send 403 response immediately.
But again I suggest you to use Request Filtering to cut off these requests on probably earlier stage.

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 17 guests