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

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

android - Keyboard hides my half of edit-text and button below it even in scroll view -