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 - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

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