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++: Boost interprocess memory mapped file error -

python - IO.UnsupportedOperation: Not Writable -

python - malformed header from script index.py Bad header -