Can't use htaccess, so have to rely on javascript.
Say the url is example.com/page1/page2/page3/ and I want to redirect this to example.com/page4/page3/ how would I do this? (and have this work for anything that has anything as page3 and has any subfolders after that as well). And also that page3 can be anything, so a wildcard would have to be in place for this..
Plus: Say the url is example.com/page1/page2/page3/page5/183/ and I want to redirect this to example.com/page4/page3/ how would I do this? (cutting off page5 plus anything on the url after that).
rely on javascriptIf you mean javascript running in a browser you would need to make the urls valid before using them. If you mean javascript running on the server it should be pretty easy. Please clarify.