Hayat Engineering Works
Hayat Engineering Works
Noida, Uttar Pradesh
SEND SMS
SEND EMAIL
 
Contact Details
View MapAddress:

Get Direction

Hayat Engineering Works
Jamir Anwar(Manager)
F- 120, Sector 8, Noida - 201301, Uttar Pradesh, India
Call Us:
Send SMS
 Other Contact Details
Contact Us
Reach Us
Jamir Anwar (Manager)
F- 120, Sector 8
Noida- 201301, Uttar Pradesh, India



Call Us

Share Us

F GT L


Send E-mailSend SMS
; header("Location: $redirect"); exit; }else if($PAGE_HEADER_STATUS == 404 && ($pagename_fetch == "new-items") && !empty($HEADER->CAT_INDEX)){ $pattern = '#(.*)/.*\.html#'; $replacement = '$1/'; $redirect=preg_replace($pattern, $replacement, $_SERVER['SCRIPT_URI']); $redirect=$redirect.$HEADER->CAT_INDEX; header("Content-type: text/html"); header("HTTP/1.1 301 Moved Permanently"); header("Location: $redirect"); exit; }else if($PAGE_HEADER_STATUS == 404 && ($pagename_fetch == "contact" || $pagename_fetch == "contacts" || $pagename_fetch == "contact-us" || $pagename_fetch == "contact_us" || $pagename_fetch == "contactus")){ $pattern = '#(.*)/.*\.html#'; $replacement = '$1/'; $redirect=preg_replace($pattern, $replacement, $_SERVER['SCRIPT_URI']); $redirect=$redirect.'enquiry.html'; header("Content-type: text/html"); header("HTTP/1.1 301 Moved Permanently"); header("Location: $redirect"); exit; }else{ $glid = (isset($URL_DETAIL->GLUSR_USR_ID)) ? $URL_DETAIL->GLUSR_USR_ID : ''; $catindex=!empty($HEADER->CAT_INDEX)?$HEADER->CAT_INDEX:''; $redirect_url = !empty($glid) ? get_redirection_url($glid,$catindex,$companybasicDetail) : ''; //Get redirection URL if any if(!empty($redirect_url)){ header("HTTP/1.1 301 Moved Permanently"); header("Location: ".$redirect_url); } else{ header("HTTP/1.0 404 Not Found"); $companybasicDetail->pagelinktype = 'notfound'; include TMPL_PATH."{$URL_DETAIL->PC_CLNT_TMPL_PATH}/notfound.php"; } } } if(isset($_REQUEST['showdata'])){ echo "





";
print_r($_SERVER);
print_r($companybasicDetail->companyhash);
}

#/home/indiamart/redirect/connecttdw.pl cron create /home/indiamart/public_html/cgi/tmpredirect/redirect_url.txt and update IIL_RED_GLUSR_DONE from 0 to 1

function get_redirection_url($glid='',$catindex,$companybasicDetail)
{  
	$last_digit = $glid%10;
	$file = '/home3/indiamart/public_html/cgi/redirection_tdw/redirectiontdw'.$last_digit.'.txt';

	if(!file_exists($file)) return '';

	$handle = @fopen($file, "r");
	$redirect='';
	if ($handle) {
		while (($buffer = fgets($handle, 4096)) !== false) {
             
			$url = explode('=>',$buffer);

			//Replacing new line
			$url[1]  = preg_replace('#\n#',"",$url[1]);
			//$m_newurl=preg_replace('/www\./','m.',$url[0]);
// 			echo "==$url[0] ==$url[1] ===";
//             $url[0]=changeHttpPath("{$url[0]}");
//             $url[1]=changeHttpPath("{$url[1]}");
//     if(preg_match("/https:/",$_SERVER['SCRIPT_URI'])){
//         $SCRIPT_URI=preg_replace("/https:/","http:",$_SERVER['SCRIPT_URI']);
//     }else{
//         $SCRIPT_URI=$_SERVER['SCRIPT_URI'];
//     }

     $SCRIPT_URI=preg_replace('#^http:/\/\www\.|https:/\/\www\.#',"",$_SERVER['SCRIPT_URI']);
     




 
	if(!empty($url[0]) && ( preg_match("#{$SCRIPT_URI}#",$url[0])  || ((preg_match('#^http:/\/\m\.|https:/\/\m\.#',$SCRIPT_URI)) && $m_newurl == $SCRIPT_URI))){
	

            $old_url=$url[0];
            $new_url=$url[1];
            $old_url=$companybasicDetail->changeHttpPath("$old_url");
            $new_url=$companybasicDetail->changeHttpPath("$new_url");
            
				if(!empty($new_url)){ 
					$redirect=$new_url;//New URL to be redirected
					
				}elseif($catindex != '' && preg_match('#\.html$#',$catindex)){  
                    $catindex=$companybasicDetail->changeHttpPath($catindex);
                    $pattern = '#(.*)/.*\.html#';
					$replacement = '$1/';
					$redirect=preg_replace($pattern, $replacement, $old_url);
                    $redirect=$redirect.$catindex;
				}else{ 
					//If New URL is blank, then send to Home page
					$pattern = '#(.*)/.*\.html#';
					$replacement = '$1/';
					$redirect=preg_replace($pattern, $replacement, $old_url);
                    
					
				}
				break;
			}

		}
		fclose($handle);
	}

	return $redirect;
}
?>