Get current full url in php


$currentPage =  'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 
 
If you want to check that ssl is enable or not then use below code
 
$currentPage =  (isset($_SERVER['HTTPS']) ? "https" : "http") . "://". $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];

Share on Google+Share on FacebookTweet about this on TwitterEmail this to someone
 
 

404 redirect in .net website

Add below code in your web.config file

<customErrors mode="RemoteOnly" defaultRedirect="your_redirect_url" redirectMode="ResponseRewrite">
   <error statusCode="404" redirect="your_redirect_url" />
</customErrors>

<httpErrors errorMode="Custom" existingResponse="Replace">
	<remove statusCode="401" subStatusCode="-1" />
	<remove statusCode="403" subStatusCode="-1" />      
	<remove statusCode="404" subStatusCode="-1" />                
	<remove statusCode="500" subStatusCode="-1" />
	<error statusCode="401" path="your_redirect_url" responseMode="Redirect" />
	<error statusCode="403" path="your_redirect_url" responseMode="Redirect" />
	<error statusCode="404" path="your_redirect_url" responseMode="Redirect" />                
	<error statusCode="500" path="your_redirect_url" responseMode="Redirect" />
</httpErrors>
Share on Google+Share on FacebookTweet about this on TwitterEmail this to someone
 

How to get woocommerce page urls

Shop Url

$aUrl = get_permalink( woocommerce_get_page_id( 'shop' ) );

Cart Url

global $woocommerce;
$aUrl = $woocommerce->cart->get_cart_url();

Checkout Url

global $woocommerce;
$aUrl = $woocommerce->cart->get_checkout_url();

Account Url

$aAccountPageId = get_option( 'woocommerce_myaccount_page_id' );
$aUrl = get_permalink( $aAccountPageId );
Share on Google+Share on FacebookTweet about this on TwitterEmail this to someone