PHP Redirection Formula

December 12, 2012

Create a 301 redirect forcing all http requests to use either http://www.example.com or example.com:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.example.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteRule ^/?$ "http\:\/\/example\.com\/" [R=301,L]

Redirect to example.com/index.php

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com$
RewriteRule ^$ http://example.com/index.php [L,R=301]

Redirect visitors to a new site
Create a 301 redirect for all http requests that are going to the old domain.

  • Example 1 – Redirect from oldexample.com to http://www.newexample.com
  • Example 2 – Redirect from oldexample.com to newexample.com
RewriteEngine On
RewriteCond %{HTTP_HOST} !oldexample.com$ [NC]
RewriteRule ^(.*)$ http://www.newexample.com/$1 [L,R=301]

This is useful when you use http://www.newexample.com as your new domain name (see also this article about redirecting www and non-www domains). If not – use the code of example 2.

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !oldexample.com$ [NC]
RewriteRule ^(.*)$ http://newexample.com/$1 [L,R=301]

301 Redirect: xyz-site.com to http://www.xyz-site.com

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www.xyz-site.com$ [NC]
RewriteRule ^(.*)$ http://www.xyz-site.com/$1 [L,R=301]

301 Redirect: http://www.xyz-site.com to xyz-site.com

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^xyz-site.com$ [NC]
RewriteRule ^(.*)$ http://xyz-site.com/$1 [L,R=301]

301 Redirect: Redirecting Individual pages

Redirect 301 /previous-page.html http://www.xyz-site.com/new-page.html
These scripts should be placed in the .htaccess file. I chose to expose these .htaccess methods first since they are most flexible and powerful of them all. These examples alone serve as a great case for hosting on Linux web servers.

Redirect with PHP

<?php
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.xyz-site.com" );
exit(0);
?>

  • This script should be the first piece of code on the page to function correctly.

How to do 301 redirect in PHP ?
If you want to redirect a single page to another location then put the following code in the old page which have been moved.

<?php
 header('HTTP/1.1 301 Moved Permanently');
 header('Location: http://www.new-domain.com/new-file-name.php');
?>

If you want to redirect non-www to www domain name then put the following code into top of every page of the website

<?php
if (substr(getenv('HTTP_HOST'),0,3) != 'www')
{
  header('HTTP/1.1 301 Moved Permanently');
  header('Location:http://www.'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
}
?>

How to do 301 redirect in .htaccess file?
Put the following code into the .htaccess file and upload it into the root folder of the website. Note that this file only works for the website which is running under Apache Web Server.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain\.com
RewriteRule (.*) http://www.domain.com/$1 [R=301,L]
 

The 13 most significant smart phones ever

December 10, 2012

A brief record of the smart phone
While the industry did not really go absolutely insane until 2007, the growth and promotion of what we think of as smart phones goes returning to the beginning 90’s. Here is a look at some of the milestone gadgets that we’ve seen along the way.

1 – IBM Simon:
Repeatedly said to be the first genuine smart phone, Simon was a specialized fail that however suggested at the opportunities of the style.
ibm-simon2 – Sony Ericsson
Sony Ericsson’s inspiration system, also known as “Penelope,” may have been the first to use the name “smartphone,” in 1997.

sony-ericsongs88

3 – Palm Pilots
While they remaining out the “phone” aspect of the process, present-day mobile phones are immediate enfant of the PDAs, Hand Aviators, and other connected handhelds that saw use in the mid to delayed 1990’s. Shown here is the Lead 5000, from 1996.

palm-pilot

4 – The BlackBerry
The original BlackBerry 850, released in 1999 by Canadian company Research In Motion.

blackberry-850

5 – Treo
Sister Publication PCWorld was very stunned at 2003’s Handspring Treo, which featured most of the modern smart phone, along with a camera and a key pad.

Tero

6 – And BlackBerry again
The 7250 model, pictured here, was the first to present CDMA connectivity and Bluetooth.

blackberry-7250

7- The iPhone
In 2007, it all customized. The apple company designed on its tremendously valuable iPod device and came up with the iPhone, which was the first smart phone to get common customers as delighted about the idea as the corporate world was.

iphone-2007

8 – Android
The HTC Desire, which many know as the T-Mobile G1, was launched more than a period after the iPhone, to far less anticipation.

android-tg1

9- iPhone 3GS
Integration the quicker 3G connection of the basic “iPhone 3G” model with a number of upgrades to overall presentation and life cycle of battery assisted 2009’s iPhone 3GS force customer passion to new levels.

iphone3gs

10 – Motorola Droid
The first sign that the Android operating system foundation might be splitting into the mainstream came with the Motorola Droid in 2009.

This device combines a physical keyboard with robust hardware, an impressive screen, and free GPS navigation.

motorola-droid

11 – iPhone 4
Apple’s redesigned iPhone 4 another time pressed the limits of the technology available in 2010.

iphone4

12 – Samsung Galaxy S III
The Galaxy S III, introduced this summer, is part of a long line of apparent “iPhone killers,”

Samsung-Galaxy-SIII

13 – iPhone 5
The sixth generation of the iPhone is each spot as impressive and exciting as we’ve come to be expecting from Apple, and early indications are that it’s already challenge some of Android’s recent market share gains.

iPhone-5

Source:  http://www.infoworld.com/slideshow/77517/the-14-most-influential-smartphones-ever-208794#slide1


Social Networking Like & Follow Code

December 5, 2012

Facebook :
 <div class=”fb-like” data-href=”http://www.facebook.com/abc&#8221; data-send=”true” data-width=”450″ data-show-faces=”true”></div>
===============================================================
<div id=”fb-root”></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = “//connect.facebook.net/en_US/all.js#xfbml=1”;
fjs.parentNode.insertBefore(js, fjs);

}(document, ‘script’, ‘facebook-jssdk’));</script>
Source : http://developers.facebook.com/docs/reference/plugins/like/
===============================================================

Linkedin :
<script src=”//platform.linkedin.com/in.js” type=”text/javascript”></script>

<script type=”IN/FollowCompany” data-id=”http://www.linkedin.com/company/abc&#8221; data-counter=”right”></script>
Source : http://developer.linkedin.com/plugins/follow-company
===============================================================

Google + :
<!– Place this tag where you want the +1 button to render. –>
<div class=”g-plusone” data-annotation=”inline” data-width=”300″></div>
<!– Place this tag after the last +1 button tag. –>
<script type=”text/javascript”>
function() {
var po = document.createElement(‘script’); po.type = ‘text/javascript’; po.async = true;
po.src = ‘https://apis.google.com/js/plusone.js&#8217;;
var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(po, s);
})();

</script>

Source: https://developers.google.com/+/plugins/+1button/#target-url


How to create a page on wikipedia

December 5, 2012

First

One short description about company website around 300 words including BSE and NSE Details with company based details, and some services details which its providing.

History

Require at least 500 to 600 words one-company history details…

Services wikipedia

Which kind of services it’s providing please mention details….

If you have a website than you need to give information Like:

  1. Engineering  – Offering services in Hardware, Embedded, Mechanical and Software Product Engineering
  2. Architect.
  3. Outsourcing Development
  4. Enterprise Application
  5. Banking Solutions

Acquisitions and Joint Ventures:

Awards
If company has got some prizes in its business year, please mention here….

References:
Any good outside link where company has participated any event or any company news shows on different website.

External Links:
Official Website – Link to your website homepage

Here some useful information require:
Traded as: 1 – BSE, 2 – NSE

  1. Industry
  2. Founded
  3. Founder(s)
  4. Headquarters
  5. Area served
  6. Key people
  7. Services
  8. Revenue
  9. Employees

Some of these valuable resources based on this information:


%d bloggers like this: