Forum Moderators: open
ErrorDocument 404 /notfound.html
Replace notfound.html with the name of the file you want visitors redirected to.
I had tried the AllowOverride and it messed things up real bad
in my webshell so I couldn't access it for a few hair-raising minutes. Is it trying to tell me something?
> When I make up a page for instance www.mydomain.com/fakepage.html it goes to the right page but it shows the name of the page I made up in the address bar.
That's normal. A 404 error is produced for fakepage.html
--------------------
> /htdocs/xx/xx/mydomain.com/.htaccess: AllowOverride not allowed here
The above should have created a 500 Internal Server Error. AllowOverride is not allowed in .htaccess
It is used in the main Apache httpd conf files, usually in access.conf or httpd.conf
--------------------
> Directory index forbidden by rule:
This would have created a 403 Forbidden access error and occurs if there is no default index page eg index.html
To allow directory listings when there is no default page add to your .htaccess file
Options Indexes
Also you should be able to change the default index page by adding to .htaccess
DirectoryIndex index.php3 index.htm index.html default.htm
Using the above example if there is no page specified in the URL eg "http://www.domain.com" Apache will look for index.php3. If index.php3 does not exist it will look for index.htm and so on.
---------------------
It is a good idea to check that .htaccess cannot be viewed in a web browser "http://mydomain.com/.htaccess"
If you get a Forbidden access error it's protected. If the browser displays a listing of your .htaccess file add the following to it.
<Files .htaccess>
deny from all
</Files>
ErrorDocument 404 [herdomain.com...]
I would not recommend using full URLs for 404 errors. They are treated as 302 redirects and could cause problems or get you banned with search engines.
Whenever a full URL is used it becomes a 302 redirect.
ErrorDocument 404 [yourdomain.com...]
I learnt the hard way. The best practice is to use relative paths only for 404 errors.
ErrorDocument 404 /missing.html
ErrorDocument 404 /errors/missing.html
Edited by: Gorufu