Here are the steps assuming that your view controller (which hosts the webview) is already in the navigation controller.
Inside .h - make sure your view controller matches the webview delegate
UIViewController <UIWebViewDelegate>
Inside .m - add the following code (or just implement this method using any logic)
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{ if (navigationType == UIWebViewNavigationTypeLinkClicked) { YourNextViewController *ynvc = [[[YourNextViewController alloc] initWithNibName:@"YourNextViewController" bundle:nil] autorelease]; ynvc.ivar1 = value1; ynvc.ivar2 = value2; UIBarButtonItem *backButton = [[[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStyleBordered target:nil action:nil] autorelease]; [[self navigationItem] setBackBarButtonItem:backButton]; [self.navigationController pushViewController:ynvc animated:YES]; return NO; } return YES;}
source share