vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   .htaccess 404 error page (https://vborg.vbsupport.ru/showthread.php?t=206108)

Winterworks 02-21-2009 10:50 AM

.htaccess 404 error page
 
I want something like...

http://batzempire.com/404/index.php

So if you go to a page that doesn't exist, it shows up as a page like that. (BatzEmpire is not my site, I'm using it as an example).. so how can I make a .htaccess file first of all? And then, what can I put in it to make it show a 404 page, and how do I make the 404 page?

Dismounted 02-21-2009 11:23 AM

Use the ErrorDocument directive.

vbplusme 02-21-2009 11:30 AM

This is the .htaccess code that tells the server where to find the documents.

Code:

# custom error documents
ErrorDocument 401 /401.shtml
ErrorDocument 403 /403.shtml
ErrorDocument 404 /404.shtml
ErrorDocument 500 /500.shtml

You just create a standard html page with the message you want and name it per the naming structure in the .htaccess file. The error documents in this care are in the root with the .htaccess file. I am pretty sure that page you are referencing was done with cPanel utility. If you have cPanel, got to the error pages in the advanced features. It contains the templates you can use to make the error documents.

HTH

Winterworks 02-21-2009 12:07 PM

How do I make a .htaccess page...?

I made a .txt file called .htaccess, with nothing else, and when I uploaded it, it simply disappeared.. It doesn't show up in the FTP, and when I view a unknown page, it won't show the error.

vbplusme 02-21-2009 12:30 PM

That's because on unix its SUPPOSE to be an invisible file. Your server must be configure to enforce that but usually you can see them in ftp, you should check your client to see if it has a "display invisible files" parameter and enable it.

Often people work on .htaccess file locally and call them htaccess.txt to avoid complication with operating systems like windows when it doesn't like a file with no name and only an extension.

Actually, you have it backwards, you should make the error pages first so you know for sure what to put in the .htaccess file.

Forgot to ask, do you have access to cPanel?

Winterworks 02-21-2009 12:36 PM

Yes I do have access to cPanel. Thank you for helping.

firstrebel 02-21-2009 05:52 PM

If you check your web site access logs with something like Awstats then setting up a 404 with htaccess may not show any 'pages not found'. This is a known issue.

Bob


All times are GMT. The time now is 01:06 AM.

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.00965 seconds
  • Memory Usage 1,721KB
  • 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_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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