Portal Home > Knowledgebase > Articles Database > how redirect error 404 to index.php? -----> help please
how redirect error 404 to index.php? -----> help please
Posted by sashaiel, 08-17-2011, 06:35 AM |
Hi everybody,
I'm trying to redirect 404 error page to my homepage (index.php).
I have kloxo panel, so in "error handlers" I put "/index.php"
but it not working.
then I put "ErrorDocument 404 /index.php" in start of .htaccess file
it still not working and shows the 404 error page.
anybody know why?
I 'll be really thankful if you could help me about this
Last edited by sashaiel; 08-17-2011 at 06:44 AM.
|
Posted by SwaggerHost, 08-17-2011, 06:44 AM |
do you have rewrite engine on?
|
Posted by icethundernet, 08-17-2011, 06:45 AM |
maybe a htacces generator might help [look at the bottom]
http://cooletips.de/htaccess/
|
Posted by sashaiel, 08-17-2011, 06:49 AM |
yes datdesi, it's ON.
I attached my .htaccess
maybe it help to finding the problem
Attached Files
htaccess.zip
(1.8 KB, 621 views)
|
Posted by SwaggerHost, 08-17-2011, 07:45 AM |
Uncomment the code in welcome.conf under /etc/httpd/conf.d
#
# Options -Indexes
# ErrorDocument 403 /error/noindex.html
#
I found that from another forum, is the htaccess that you uploaded the one that came with it??
|
Posted by Surcouf, 08-17-2011, 07:58 AM |
you have to create 404.shtml on your root directory of your website (www repertory) and you have to include a redirection code in this page. I'm not totally sure.
|
Posted by ursa-musculus, 08-17-2011, 08:16 AM |
When you say "it still shows the 404 error page", what error page do you mean? Could you attach a screenshot, or post a link of a URL on your site that is not giving the error page you want?
[The .htaccess file you attached is for a joomla installation, in which case directing to index.php is how it handles custom URLs. If the error page you are getting has been rendered by Joomla, then that line is working correctly in your .htaccess file. If you want a custom error page within your Joomla site, that would be a setting in Joomla.]
|
Posted by SwaggerHost, 08-17-2011, 12:25 PM |
What James said, its part of your joomla installation. and according to this link http://docs.joomla.org/Creating_a_Custom_404_Error_Page it looks like you dont even have to mess with your .htaccess, I maybe be wrong since its been a while since I have used joomla.
|
Posted by whh-kevinw, 08-17-2011, 03:33 PM |
Hi sashaiel, this is Kevin with Web Hosting Hub.
I looked at your .htaccess file and I noticed that you had the line about 404 before you stated that the rewrite engine should be on. I would recommend updating the beginning of your .htaccess so it looks more like this:
RewriteEngine on
ErrorDocument 404 /index.php
I hope this helps. Let me know if it doesn't and I'll be more than happy to look into it further.
|
Posted by sashaiel, 08-18-2011, 09:48 PM |
so finally , this one works well.
thanks a lot datdesi and everybody for your great helps.
|
Add to Favourites Print this Article
Also Read
VPSLink down? (Views: 846)