2 fredsy Mar 23, 2011 08:56

Use .htaccess to send 404 response if requested URI matches disp=comments
Ah, I'd been trying redirects, but had completely (stupidly) forgotten about 404s. Is there a way to get the b2evo 404 page to appear? I've never done 404s before manually but all the tutorials on the net show is how to direct to a file: would I just do a condition where it points to the 404 skin file?
I've used b2evo for a while and I'm guessing that wouldn't work properly...
Redirect to ?disp=404 ;)
Thanks. I'm still struggling to find a decent tutorial (that isn't just a generic 404 one) but in the meantime: I'm guessing that if I just delete the skin file, b2evo will throw up errors of its own? This is one of those things I just wish I could turn off in the backend... I really don't need a whole page of comments, just the comments to appear on the posts themselves.
Edit the file /inc/_blog_main.inc.php line 606 and add the following
switch( $disp )
{
//case 'subs':
//case 'arcdir':
//case 'catdir':
case 'comments':
$disp = '404'; // Display 404 Not found page
}
if( !empty($disp_handlers[$disp]) )
You can disable some other disp types, just uncomment them or add new.
There is no line 606 (note I'm using 3.3.2) in that file. Can you tell me where specifically to add it?
Thanks so much for the help!
Add the code I wrote above this line of code
if( !empty($disp_handlers[$disp]) )
You should see it near the end of the file, use search
I get the following errors, along with needing to re-upload the file when I delete the added code:
Warning: preg_match() [function.preg-match]: Unknown modifier '¤' in public_html/inc/_blog_main.inc.php on line 125
Warning: Cannot modify header information - headers already sent by (output started at /home/schoolof/public_html/inc/_blog_main.inc.php:120) in /public_html/inc/skins/_skin.funcs.php on line 602
Warning: Cannot modify header information - headers already sent by (output started at public_html/inc/_blog_main.inc.php:120) in /home/schoolof/public_html/inc/_core/_template.funcs.php on line 59
Get a new code editor. The one you're using is obviously butchering line endings, or changing the character encoding, or something weird.
You can safely replace all occurrences of '¤' with '~'
I don't know why devs decided to use that weird character that can't be typed on a standard keyboard.
Perfect! Thanks so much, it all works now :)
Does anybody have any answers to this? I've tried a number of ideas but still nothing has worked.