MyBB Community Forums

Full Version: Redirect guests to external page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey,

I currently have a membership plugin that creates users and adds them to the MyBB database, the whole of the website is private and therefore I don't want guests to view it BUT also I don't want guests to signup through the forum itself. When guests visit the forum I need them to be redirected to the page of my website where they can signup.

I'm no good with PHP but this is pretty much the command I need Toungue

if user = guest then redirect to http://example.com

Thanks so much in advance, loving 1.8 btw Big Grin
One method would be:
Locate the following template: header > header_welcomeblock_guest

Add anywhere:

<script type="text/javascript">
window.location = "http://www.example.com";
</script>

But of course this won't work unless your guest has javascript enabled!
You could replace the error_nopermission template and put the link there.
Close registration and put a link on the no permissions page. If you do a redirect then if a registered user isnt logged in they will be redirected and will remain unable to log in.
Okay thanks, I will try this! :-)