Results 1 to 3 of 3

Thread: Hybrid site: redirect after page

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2004

    Default Hybrid site: redirect after page

    Pasting together an existing site with vb3 and cmps...

    Some areas are for registered members only. The registration system is now vb3. I cannot convert all of the old site into vb3/cmps at once. I think I need a "hybrid" to get by.

    So in my old sections I write:

    PHP Code:
    if ($NoCurrentSession) {
    header("Location: /forum/cmps_index.php?page=forbidden");

    where "forbidden" is a cmps page with no access privleges. So this brings up the "You are not logged in" prompt, which is desired.

    But of course, after login, the system returns to "You do not have permission to access this page". It's the God's honest truth. But if the user clicks again on where they were going, they are off to the races.

    All site areas are linked across the top, and all are always enabled. This is desired. The ones which go to vb pages behave correctly: after denial followed by login, the system redirects to the original page.

    I wonder how I can mimic this to support old sections... ?

    Thanks in advance.

  2. #2
    Join Date
    Jan 2004
    Georgia, USA

    Default Re: Hybrid site: redirect after page

    I'm not entirely sure I understand what you're trying to do, so please excuse me if this is not correct... Once you log into vBulletin though, it will redirect you to the page that you logged in from. Since they logged in from your forbidden page, they are going to be redirected to that page. I might suggest adding a custom php module for that page which will check to see if a user is logged in, and if not, then print the error. Then change the code you posted above to something like this:
    PHP Code:
    if ($NoCurrentSession) { 
    header("Location: /forum/cmps_index.php?page=forbidden&return="); 

    You could then use the 'return' part in the URL there to redirect the user to that specific page in the module that you created, assuming that they are logged in.

  3. #3
    Join Date
    Jun 2004

    Default Re: Hybrid site: redirect after page

    You understood perfectly and your answer is helpful, thank you.

    I had hoped there might be some magic buried in either vb or vbadvanced already...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Created a Custom Page and...
    By mholtum in forum Troubleshooting / "How do I..." Questions
    Replies: 3
    Last Post: 06-21-2004, 04:34 PM
  2. Site Index (like your Services Box) Everywhere
    By george bray in forum Troubleshooting / "How do I..." Questions
    Replies: 4
    Last Post: 05-27-2004, 09:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts