javascript - Redirect all pages except a few specific ones -


i need use javascript on this, , place in header site pages.

//.mysite.com - redirect pages within domain //.mysite.com/home

except these 3 page examples, don't want these redirected.

www.mysite.com/page2  www.mysite.com/article/sat www.mysite.com/home/message 

any ideas? i've never had request this.

if (['/page2', 'article/sat', 'home/message', '/home'].indexof(window.location.pathname) < 0)     window.location = 'www.mysite.com/home' 

no need jquery


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -