vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   301 Redirect Deleted Threads to Forum Index (https://vborg.vbsupport.ru/showthread.php?t=257148)

regeneration 01-14-2011 10:48 PM

301 Redirect Deleted Threads to Forum Index
 
Hi Everyone,

I have a question and hoping someone could help me out.

As you know, if someone is visiting a deleted thread on Vbulletin, he will get an "invalid thread" page. What I'm trying to do is... to add a 301 redirect to forum index page after a few seconds inside the "invalid thread" page, but with PHP redirect (not meta refresh).

I've tried to create a PHP function that does that, but it doesn't work (blank page).

Does anyone have a clue?

Thanks in Advance,

kh99 01-14-2011 11:01 PM

Did you try something like:

PHP Code:

$vbulletin->url 'index.php?' $vbulletin->session->vars['sessionurl'];
eval(
print_standard_redirect("Invalid Thread"false)); 


You can also use a phrase instead of text (see function print_standard_redirect() in includes/functions.php).

ETA: sorry, I just reread your post and noticed the "after a few seconds" part, so maybe this doesn't help. (But maybe that's what the "forceredirect" parameter of print_standard_redirect() is for?).

Alfa1 01-14-2011 11:18 PM

Wouldn't that cause even more confusion than the also confusing 'no permissions' page?

JamesC70 01-15-2011 05:31 PM

Quote:

Originally Posted by regeneration (Post 2149193)
As you know, if someone is visiting a deleted thread on Vbulletin, he will get an "invalid thread" page. What I'm trying to do is... to add a 301 redirect to forum index page after a few seconds inside the "invalid thread" page, but with PHP redirect (not meta refresh).

I've tried to create a PHP function that does that, but it doesn't work (blank page).

A PHP redirect is done in the header of the page. Since you're already sending a page saying "invalid thread", you can't add the redirect later in the page.

Instead, maybe you could create an HTML form with only a submit button... which then takes the viewer to whatever page you wanted to redirect them to. The form would ideally display inside the error message box, so that it's obvious to the viewer that they should click it to return to your forumhome.


All times are GMT. The time now is 03:48 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00923 seconds
  • Memory Usage 1,720KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete