hi all. does anyone know of a way to hide a specific page’s URL? my site is password protected on the homepage, but i’d like to prevent people from being able to jump directly to a sub page with a direct URL.
Hi,
Sounds like you need to use routers, you can check it out here .
Good luck
Thanks! Are you recommending I use routers as a way to send users back to the homepage if a password session variable hasn’t been set?
Or is there actually a way to change the URL of a page itself? If so, I can’t seem to find that, but perhaps I’m missing something.
Thanks!
Bumping up to see if anyone has some suggestions… thanks!
Hi,
You can use the routers to authenticate users and then display content just for them.
Thanks! I’ve got routers working between the pages, but am still a bit stumped on how to authenticate users. I only have one password login (not interested in doing member pages), so I’m not sure how to track a user across one visit. The best solution I’ve figured out so far is tracking what the referring page is and seeing if it’s internally to the site - if it’s a direct URL entry, you are redirected to the login page, otherwise you can continue to the page. I don’t really like this as a solution - it seems like a messy way to handle it and I’d rather determine if the user has entered the password already. Could someone please elaborate a bit more on how I could track that and access it from the routers backend side? Thanks so much!
Hi,
You can get information about the user and its login status with wixUsers, check it out here .
Thanks for the reply! Could you please elaborate a bit further? I’ve tried wixUsers in the frontend code to identify the user, but can’t figure out how to get that information to the router to determine how to redirect the page.
To clarify, I’ve also tried using the user data that is part of the WixRouterRequest, but since I don’t have member pages (just a single password login), I don’t have any user data in that request. It comes in null. Thanks for any advice you can offer!
Hi,
Do you mean you have created your own log-in system? do you have all usernames and passwords saved in a database? You can save a cookie that determines whether the user is logged in, if the cookie exists the user is logged in. You should also check out this post about log in systems.
Good luck
Hi again. I have been using the password option to have one password on the home page. On the Site Menu, I select the Home Page-> Settings → Permissions, I select “Password Holders” rather than “Members Only.”
I have tried setting a cookie to track if a user is logged in and that works fine across pages, but the session (wix-storage) variables all are on the front-end and I cannot seem to access that data from the backend router file to determine where to route the page.
Thank you for the link. I have read that, but seem to come across the same problem when I looked into setting up my own login system that I cannot get the data from the front-end to the back-end files. Any thoughts?
Thanks again for the help! I sincerely appreciate it.