Brief Idea: I am building script for protecting my webdesign work by locking them on Single domain. If website is uploaded on different domain, It will redirect to my website. Means it won't allow to load actual website from different domain except I specify them.
My Working Script:
-- DECODED SCRIPT --
[]['constructor']['constructor'](self['unescape']('if(~location.protocol.indexOf('http:')&&~location.host.indexOf('isupportu.in')){}else(location.href='http://iamwebdeveloper.in')'))()
Here on above code, I am allowing my work to load on "www.abc.com" with http protocol only. However it won't work if we load website without www i.e. "abc.com".
www.abc.com --> Website load
abc.com --> www.iamwebdeveloper.in
xyz.com --> www.iamwebdeveloper.in
www.xyz.com --> www.iamwebdeveloper.in
I decided to use .htaccess
/ web.config
file to force redirect domain without www. request to www.abc.com [which is working very well]
But now I want to upgrade this script and I need your help:
- Don't want dependency on .htaccess / web.config file for redirecting non www. request.
- www. and non www request should accept, but no subdomain allow. For e.g. subdomain.abc.com is not allowed.
- I want to add multiple domains in script for big clients who has multiple domain for their single website as Addon domain. I want to add more domain in above script.
Can someone help me to validate this script for my above logic ?
[]["constructor"]["constructor"]
(
self["unescape"]
("<!-- I WILL USE THIS CODE AFTER CONVERTING TO ESCAPE TEXT AND IGNORE THIS COMMENT -->
if (location.protocol.indexOf("http:") && ( (location.host.indexOf("isupportu.in")) || (location.host.indexOf("paytronicindia.com")) || (location.host.indexOf("paytronicworldwide.com")) || (location.host.indexOf("paytronicnetwork.com")) )
){}else(location.href='http://iamwebdeveloper.in')
")
)
()