If month is december redirect, if not then dont HTML JS
Go to solution
Solved by C2dan88,
I have expanded @Eigenvektor code to use absolute paths. Comments explains whats going
// if month is december if (new Date().getMonth() == 11) { // if user is at site.com/ or site.com/index.html // redirect to site.com/char/index.html if (window.location.pathname == "/" || window.location.pathname == "/index.html") { window.location.replace("/chr/index.html"); } } // month is not decemeber else { // if user is at site.com/char/ // redirect to site.com/index.html if (window.location.pathname.startsWith("/chr/")) { window.location.replace("/index.html"); } }
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now