This is a two part answer. Part 1 as Abdul said you have to handle the controller so you can redirect them to the custom page after its successful.
Part 1, lets take over the contacts controller, then we can handle the redirect to a custom page.
Create a custom module called Contacts Step 1 create the module declaration in app/etc/modules/ and call it something like Rajat_Contacts.xml
<?xml version="1.0"?>
<config>
<modules>
<Rajat_Contacts>
<active>true</active>
<codePool>local</codePool>
</Rajat_Contacts>
</modules>
</config>
Now create the module in app/code/local
Create a folder called Rajat and inside that two folders etc/ and controllers
Inside app/code/local/Rajat/Contacts/etc/ create a file called config.xml and put this
<?xml version="1.0"?>
<config>
<modules>
<Rajat_Contacts>
<version>1.0.0</version>
</Rajat_Contacts>
</modules>
<frontend>
<routers>
<contacts>
<args>
<modules>
<rajat_contacts before="Mage_Contacts">Rajat_Contacts</rajat_contacts>
</modules>
</args>
</contacts>
</routers>
</frontend>
</config>
Now in app/code/local/Rajat/Contacts/controllers create a file called app/code/local/Rajat/Contacts/controllers/IndexController.php and here is the contents:
<?php
require_once(Mage::getModuleDir('controllers', 'Mage_Contacts') . DS . 'IndexController.php');
class Rajat_Contacts_IndexController extends Mage_Contacts_IndexController
{
public function postAction()
{
$post = $this->getRequest()->getPost();
if ( $post ) {
$translate = Mage::getSingleton('core/translate');
/* @var $translate Mage_Core_Model_Translate */
$translate->setTranslateInline(false);
try {
$postObject = new Varien_Object();
$postObject->setData($post);
$error = false;
if (!Zend_Validate::is(trim($post['name']) , 'NotEmpty')) {
$error = true;
}
if (!Zend_Validate::is(trim($post['comment']) , 'NotEmpty')) {
$error = true;
}
if (!Zend_Validate::is(trim($post['email']), 'EmailAddress')) {
$error = true;
}
if (Zend_Validate::is(trim($post['hideit']), 'NotEmpty')) {
$error = true;
}
if ($error) {
throw new Exception();
}
$mailTemplate = Mage::getModel('core/email_template');
/* @var $mailTemplate Mage_Core_Model_Email_Template */
$mailTemplate->setDesignConfig(array('area' => 'frontend'))
->setReplyTo($post['email'])
->sendTransactional(
Mage::getStoreConfig(self::XML_PATH_EMAIL_TEMPLATE),
Mage::getStoreConfig(self::XML_PATH_EMAIL_SENDER),
Mage::getStoreConfig(self::XML_PATH_EMAIL_RECIPIENT),
null,
array('data' => $postObject)
);
if (!$mailTemplate->getSentSuccess()) {
throw new Exception();
}
$translate->setTranslateInline(true);
Mage::getSingleton('customer/session')->addSuccess(Mage::helper('contacts')->__('Your inquiry was submitted and will be responded to as soon as possible. Thank you for contacting us.'));
$thank_you_url = Mage::getUrl('thank-you');
$this->_redirectUrl($thank_you_url);
return;
} catch (Exception $e) {
$translate->setTranslateInline(true);
Mage::getSingleton('customer/session')->addError(Mage::helper('contacts')->__('Unable to submit your request. Please, try again later'));
$this->_redirect('*/*/');
return;
}
} else {
$this->_redirect('*/*/');
}
}
}
Now, use the built int CMS and create a page with the url-key of thank-you so it matches your redirectUrl we just put in the code.
That should take the customers through the same controller, but you are handling the url redirect after its successful.