Hello experts, I wrote code on .htaccess file for 404 error page. But this file now working properly. When I upload .htaccess file on directory my site show forbidden. Please help me to solve the problem. Here is the code and error page. http://www.whitehatseoteam.com/error404.html <Files ~ "^\.(htaccess)$"> deny from all </Files> Options Indexes ErrorDocument 404 error404.html RewriteEngine on RewriteCond %{HTTP_HOST} ^(whitehatseoteam\.com)(:80)? [NC] RewriteRule ^(.*) http://www.whitehatseoteam.com/$1 [R=301,L] DirectoryIndex index.html Redirect permanent http://whitehatseoteam.com http://www.whitehatseoteam.com Redirect permanent https://www.whitehatseoteam.com http://www.whitehatseoteam.com Redirect permanent https://whitehatseoteam.com http://www.whitehatseoteam.com order deny,allow PHP:
<Files ~ "^\.(htaccess)$"> deny from all </Files> Options Indexes ErrorDocument 404 /error404.html RewriteEngine on RewriteCond %{HTTP_HOST} ^(whitehatseoteam\.com)(:80)? [NC] RewriteRule ^(.*) http://www.whitehatseoteam.com/$1 [R=301,L] DirectoryIndex index.html Redirect permanent http://whitehatseoteam.com http://www.whitehatseoteam.com Redirect permanent https://www.whitehatseoteam.com http://www.whitehatseoteam.com Redirect permanent https://whitehatseoteam.com http://www.whitehatseoteam.com order deny,allow PHP: You missed out the slash after 'ErrorDocument 404'
Thanks for reply. It's not working properly. When I upload the file .htaccess file on my server. My site show forbidden. I hope you will be help me to write current code.
This line: ErrorDocument 404 error404.html Code (markup): should be: ErrorDocument 404 /error404.html Code (markup):
Thats Kind of what I said I am able to access your site fine, try getting rid of the unnecessary stuff on the .htaccess file then see if you can view your site. If you can just add each line one by one to identify the error, when you find it post back
Not tested so keep a backup of current code: RewriteEngine on RewriteCond %{HTTP_HOST} ^(whitehatseoteam\.com)(:80)? [NC] RewriteRule ^(.*) http://www.whitehatseoteam.com/$1 [R=301,L] # HTTPS REDIRECTION RewriteCond %{HTTPS}=on RewriteRule ^(.*)$ http://www.whitehatseoteam.com/$1 [R=301,L] ErrorDocument 404 /error404.html Options All -Indexes Code (markup): Try that and see how it goes
I have a feeling you should contact your host in case you are on a blacklist for some reason - I am able to see your site fine is why I say this. Good Luck