| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Custom 404 page | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() What is the best way to create custom 404 page? Is there mod for custom 404 page that can have search box to search through the site?
__________________
xcart gold 4.1.9 xcart gold 4.1.11 xcart gold 4.1.12 xcart gold 4.4.3 xcart gold 4.6.3 |
|||||||
#2
|
|||||||||
|
|||||||||
![]() Hi,
I had the exact same questions for my own site but somehow I cannot find my thread back! With the feedback from the forum guys this is basically what I did and it works like a charm for me: 1) look in your X-Cart root for the following file: error_message.php and empty the contents. 2) Open your home page in a browser and copy all the code over to error_message.php 3) Put this line of code on top of the code on the first line. <?php header("HTTP/1.0 404 Not Found"); ?> This ensures your site returns a proper 404 header when the error page is called. 4) Change your page title into something like "This page could not be found. Error 404" or similar. 5) Edit your welcome text with some text explaining how the user might have gotten there and some suggestions what to do next like: "Oops, were sorry. The requested page was not found or might have been moved. Maybe you followed an invalid link or made a typo in your address bar. We like to know how you got here and appreciate if you contact us." 6) Save and upload the error_message.php to your root and check. Now you should have a nice looking custom 404 page with all your navigations and search working. And the best thing is that your featured products are shown as well ![]() Alternatively you can add specialized code from Google Webmaster Tools that will put a Google search box on your error page called: Enhance 404 pages You can find it in the "Tools" section of your Google Webmaster tools account. Haven't tested it myself since I am using Altered Cart Smart Search which works very well instead... Hope you find this information useful for creating your own custom 404 error page. Cheers, Nico
__________________
____________________________ X-Cart Gold 4.1.10 EWD Hosting | CDSEO Pro | One Page Checkout | Smart Search | Telafirma Dynamic Images | X-AOM | Product Importer Pro and many custom mods and tweaks found here... |
|||||||||
#3
|
|||||||
|
|||||||
![]() Thank you for the step by step instruction. I will give it a try now.
__________________
xcart gold 4.1.9 xcart gold 4.1.11 xcart gold 4.1.12 xcart gold 4.4.3 xcart gold 4.6.3 |
|||||||
#4
|
|||||||
|
|||||||
![]() Is there way to make the URL stay the same on 404 error instead of jumping it to error_message.php?page_not_found=&error404=asdf?
__________________
xcart gold 4.1.9 xcart gold 4.1.11 xcart gold 4.1.12 xcart gold 4.4.3 xcart gold 4.6.3 |
|||||||
#5
|
|||||||||
|
|||||||||
![]() I don't know if that's possible, is there a reason why you'd want to prevent the url from changing?
__________________
____________________________ X-Cart Gold 4.1.10 EWD Hosting | CDSEO Pro | One Page Checkout | Smart Search | Telafirma Dynamic Images | X-AOM | Product Importer Pro and many custom mods and tweaks found here... |
|||||||||
#6
|
|||||||
|
|||||||
![]() I want to make a little useful 404 page so it displays what page user was trying to reach. I could get the URL by PHP script but if the URL redirect, I cannot get the original URL.
__________________
xcart gold 4.1.9 xcart gold 4.1.11 xcart gold 4.1.12 xcart gold 4.4.3 xcart gold 4.6.3 |
|||||||
#7
|
|||||||||
|
|||||||||
![]() You need to find where in your xcseo code that the redirect is taking place and through a 404 header and echo an error at that time. (If this portion of the xcseo code is unencrypted).
Jon Peters |
|||||||||
|
|||
X-Cart forums © 2001-2020
|