{"id":401,"date":"2009-02-12T16:09:37","date_gmt":"2009-02-12T22:09:37","guid":{"rendered":"http:\/\/webii.net\/blog\/?p=401"},"modified":"2022-01-27T16:49:45","modified_gmt":"2022-01-27T22:49:45","slug":"how-to-the-easy-3-step-php-redirect","status":"publish","type":"post","link":"https:\/\/www.webii.net\/blog\/how-to-the-easy-3-step-php-redirect\/","title":{"rendered":"How To: The Easy 3 Step PHP Redirect"},"content":{"rendered":"<p>Chances are you&#8217;ve seen a link like www.example.com\/vote that will link you somewhere, even if it is not on example.com.<\/p>\n<p>If you own your own website, you&#8217;ve probably even wondered how to use this to your advantage.<\/p>\n<p>Your initial thought might be, but only an internet wizard of mythical proportions and years of studying the arcane could be powerful enough to wield such magics as to <a href=\"https:\/\/www.webii.net\/website-services\/web-development\/\">manipulate the interweb<\/a> in this manner!<\/p>\n<p>Actually, it&#8217;s about as easy as slipping into a pair of Hammer Pants.<\/p>\n<p>There are a couple of different ways to accomplish this, but the one I&#8217;m going to show you is called a PHP 301 Redirect.<\/p>\n<p style=\"padding-left: 30px;\"><strong>1.<\/strong> First, make a directory in your website that you will want to have the redirect named after. If you wanted to make a link to your favorite singer&#8217;s web page, which is most likely MC Hammer, you would make a subdirectory called chamber in the root directory of your website. This means your link will look like this: www.yourdomain.com\/mchammer<\/p>\n<p style=\"padding-left: 30px;\"><strong>2. <\/strong>Create a file called index.php in your chamber directory, and insert this code (and only this code!) into the page:<\/p>\n<p style=\"padding-left: 30px;\">&lt;?<\/p>\n<p style=\"padding-left: 30px;\">Header( &#8220;HTTP\/1.1 301 Moved Permanently&#8221; );<br \/>\nHeader( &#8220;Location: http:\/\/www.mchammer.com);<br \/>\n?&gt;<\/p>\n<p style=\"padding-left: 30px;\"><strong>3.<\/strong> Replace the example URL (http:\/\/www.mchammer.com) with your destination of choice, and save or upload this change. Now, every time you go to www.yourdomain.com\/mchammer, you will be redirected to www.mchammer.com.<\/p>\n<p style=\"padding-left: 30px;\"><strong>4.<\/strong> STOP&#8211;Hammer Time.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Chances are you&#8217;ve seen a link like www.example.com\/vote that will link you somewhere, even if it is not on example.com. If you own your own website, you&#8217;ve probably even wondered how to use this to your advantage. Your initial thought might be, but only an internet wizard of mythical proportions and years of studying the [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":10209,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[16,11,300],"tags":[242,43],"class_list":["post-401","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-austin-web-design","category-tech-support","category-www-learning-center","tag-austin-web-design","tag-php-redirect"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.6 (Yoast SEO v27.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How To: The Easy 3 Step PHP Redirect<\/title>\n<meta name=\"description\" content=\"As an industry leader in the web development industry, WEBii knows a thing or two about PHP redirects. Just follow these steps!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webii.net\/blog\/how-to-the-easy-3-step-php-redirect\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To: The Easy 3 Step PHP Redirect\" \/>\n<meta property=\"og:description\" content=\"As an industry leader in the web development industry, WEBii knows a thing or two about PHP redirects. Just follow these steps!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webii.net\/blog\/how-to-the-easy-3-step-php-redirect\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Marketing &amp; Web Development Company Blog - WEBii\" \/>\n<meta property=\"article:published_time\" content=\"2009-02-12T22:09:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-01-27T22:49:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webii.net\/blog\/wp-content\/uploads\/2009\/02\/Code-Image.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"640\" \/>\n\t<meta property=\"og:image:height\" content=\"426\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Bobby Martinez\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Bobby Martinez\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/how-to-the-easy-3-step-php-redirect\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/how-to-the-easy-3-step-php-redirect\\\/\"},\"author\":{\"name\":\"Bobby Martinez\",\"@id\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/#\\\/schema\\\/person\\\/1bc298cae5d352e2b7409f7f0882c776\"},\"headline\":\"How To: The Easy 3 Step PHP Redirect\",\"datePublished\":\"2009-02-12T22:09:37+00:00\",\"dateModified\":\"2022-01-27T22:49:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/how-to-the-easy-3-step-php-redirect\\\/\"},\"wordCount\":258,\"publisher\":{\"@id\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/how-to-the-easy-3-step-php-redirect\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/wp-content\\\/uploads\\\/2009\\\/02\\\/Code-Image.jpg\",\"keywords\":[\"Austin Web Design\",\"php redirect\"],\"articleSection\":[\"Austin Web Design\",\"Tech Support\",\"WWW Learning Center\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/how-to-the-easy-3-step-php-redirect\\\/\",\"url\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/how-to-the-easy-3-step-php-redirect\\\/\",\"name\":\"How To: The Easy 3 Step PHP Redirect\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/how-to-the-easy-3-step-php-redirect\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/how-to-the-easy-3-step-php-redirect\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/wp-content\\\/uploads\\\/2009\\\/02\\\/Code-Image.jpg\",\"datePublished\":\"2009-02-12T22:09:37+00:00\",\"dateModified\":\"2022-01-27T22:49:45+00:00\",\"description\":\"As an industry leader in the web development industry, WEBii knows a thing or two about PHP redirects. Just follow these steps!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/how-to-the-easy-3-step-php-redirect\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.webii.net\\\/blog\\\/how-to-the-easy-3-step-php-redirect\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/how-to-the-easy-3-step-php-redirect\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/wp-content\\\/uploads\\\/2009\\\/02\\\/Code-Image.jpg\",\"contentUrl\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/wp-content\\\/uploads\\\/2009\\\/02\\\/Code-Image.jpg\",\"width\":640,\"height\":426,\"caption\":\"Photo by Markus Spiske on Pexels\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/how-to-the-easy-3-step-php-redirect\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Austin Web Design\",\"item\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/category\\\/austin-web-design\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How To: The Easy 3 Step PHP Redirect\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/\",\"name\":\"Web Marketing &amp; Web Development Company Blog - WEBii\",\"description\":\"web design . web development . seo . marketing . web hosting . + more\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/#organization\",\"name\":\"WEBii\",\"url\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/12\\\/fb-banner-webii-seo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/12\\\/fb-banner-webii-seo.jpg\",\"width\":1200,\"height\":598,\"caption\":\"WEBii\"},\"image\":{\"@id\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/#\\\/schema\\\/person\\\/1bc298cae5d352e2b7409f7f0882c776\",\"name\":\"Bobby Martinez\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/wp-content\\\/wphb-cache\\\/gravatar\\\/989\\\/989ff15d4b427e880bb1f76de01c47c3x96.jpg\",\"url\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/wp-content\\\/wphb-cache\\\/gravatar\\\/989\\\/989ff15d4b427e880bb1f76de01c47c3x96.jpg\",\"contentUrl\":\"https:\\\/\\\/www.webii.net\\\/blog\\\/wp-content\\\/wphb-cache\\\/gravatar\\\/989\\\/989ff15d4b427e880bb1f76de01c47c3x96.jpg\",\"caption\":\"Bobby Martinez\"},\"description\":\"Customer Support, WEBii\",\"sameAs\":[\"https:\\\/\\\/www.webii.net\"]}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How To: The Easy 3 Step PHP Redirect","description":"As an industry leader in the web development industry, WEBii knows a thing or two about PHP redirects. Just follow these steps!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webii.net\/blog\/how-to-the-easy-3-step-php-redirect\/","og_locale":"en_US","og_type":"article","og_title":"How To: The Easy 3 Step PHP Redirect","og_description":"As an industry leader in the web development industry, WEBii knows a thing or two about PHP redirects. Just follow these steps!","og_url":"https:\/\/www.webii.net\/blog\/how-to-the-easy-3-step-php-redirect\/","og_site_name":"Web Marketing &amp; Web Development Company Blog - WEBii","article_published_time":"2009-02-12T22:09:37+00:00","article_modified_time":"2022-01-27T22:49:45+00:00","og_image":[{"width":640,"height":426,"url":"https:\/\/www.webii.net\/blog\/wp-content\/uploads\/2009\/02\/Code-Image.jpg","type":"image\/jpeg"}],"author":"Bobby Martinez","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Bobby Martinez","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webii.net\/blog\/how-to-the-easy-3-step-php-redirect\/#article","isPartOf":{"@id":"https:\/\/www.webii.net\/blog\/how-to-the-easy-3-step-php-redirect\/"},"author":{"name":"Bobby Martinez","@id":"https:\/\/www.webii.net\/blog\/#\/schema\/person\/1bc298cae5d352e2b7409f7f0882c776"},"headline":"How To: The Easy 3 Step PHP Redirect","datePublished":"2009-02-12T22:09:37+00:00","dateModified":"2022-01-27T22:49:45+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webii.net\/blog\/how-to-the-easy-3-step-php-redirect\/"},"wordCount":258,"publisher":{"@id":"https:\/\/www.webii.net\/blog\/#organization"},"image":{"@id":"https:\/\/www.webii.net\/blog\/how-to-the-easy-3-step-php-redirect\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webii.net\/blog\/wp-content\/uploads\/2009\/02\/Code-Image.jpg","keywords":["Austin Web Design","php redirect"],"articleSection":["Austin Web Design","Tech Support","WWW Learning Center"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.webii.net\/blog\/how-to-the-easy-3-step-php-redirect\/","url":"https:\/\/www.webii.net\/blog\/how-to-the-easy-3-step-php-redirect\/","name":"How To: The Easy 3 Step PHP Redirect","isPartOf":{"@id":"https:\/\/www.webii.net\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webii.net\/blog\/how-to-the-easy-3-step-php-redirect\/#primaryimage"},"image":{"@id":"https:\/\/www.webii.net\/blog\/how-to-the-easy-3-step-php-redirect\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webii.net\/blog\/wp-content\/uploads\/2009\/02\/Code-Image.jpg","datePublished":"2009-02-12T22:09:37+00:00","dateModified":"2022-01-27T22:49:45+00:00","description":"As an industry leader in the web development industry, WEBii knows a thing or two about PHP redirects. Just follow these steps!","breadcrumb":{"@id":"https:\/\/www.webii.net\/blog\/how-to-the-easy-3-step-php-redirect\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webii.net\/blog\/how-to-the-easy-3-step-php-redirect\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webii.net\/blog\/how-to-the-easy-3-step-php-redirect\/#primaryimage","url":"https:\/\/www.webii.net\/blog\/wp-content\/uploads\/2009\/02\/Code-Image.jpg","contentUrl":"https:\/\/www.webii.net\/blog\/wp-content\/uploads\/2009\/02\/Code-Image.jpg","width":640,"height":426,"caption":"Photo by Markus Spiske on Pexels"},{"@type":"BreadcrumbList","@id":"https:\/\/www.webii.net\/blog\/how-to-the-easy-3-step-php-redirect\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webii.net\/blog\/"},{"@type":"ListItem","position":2,"name":"Austin Web Design","item":"https:\/\/www.webii.net\/blog\/category\/austin-web-design\/"},{"@type":"ListItem","position":3,"name":"How To: The Easy 3 Step PHP Redirect"}]},{"@type":"WebSite","@id":"https:\/\/www.webii.net\/blog\/#website","url":"https:\/\/www.webii.net\/blog\/","name":"Web Marketing &amp; Web Development Company Blog - WEBii","description":"web design . web development . seo . marketing . web hosting . + more","publisher":{"@id":"https:\/\/www.webii.net\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webii.net\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webii.net\/blog\/#organization","name":"WEBii","url":"https:\/\/www.webii.net\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webii.net\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.webii.net\/blog\/wp-content\/uploads\/2015\/12\/fb-banner-webii-seo.jpg","contentUrl":"https:\/\/www.webii.net\/blog\/wp-content\/uploads\/2015\/12\/fb-banner-webii-seo.jpg","width":1200,"height":598,"caption":"WEBii"},"image":{"@id":"https:\/\/www.webii.net\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.webii.net\/blog\/#\/schema\/person\/1bc298cae5d352e2b7409f7f0882c776","name":"Bobby Martinez","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webii.net\/blog\/wp-content\/wphb-cache\/gravatar\/989\/989ff15d4b427e880bb1f76de01c47c3x96.jpg","url":"https:\/\/www.webii.net\/blog\/wp-content\/wphb-cache\/gravatar\/989\/989ff15d4b427e880bb1f76de01c47c3x96.jpg","contentUrl":"https:\/\/www.webii.net\/blog\/wp-content\/wphb-cache\/gravatar\/989\/989ff15d4b427e880bb1f76de01c47c3x96.jpg","caption":"Bobby Martinez"},"description":"Customer Support, WEBii","sameAs":["https:\/\/www.webii.net"]}]}},"_links":{"self":[{"href":"https:\/\/www.webii.net\/blog\/wp-json\/wp\/v2\/posts\/401","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webii.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webii.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webii.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webii.net\/blog\/wp-json\/wp\/v2\/comments?post=401"}],"version-history":[{"count":0,"href":"https:\/\/www.webii.net\/blog\/wp-json\/wp\/v2\/posts\/401\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webii.net\/blog\/wp-json\/wp\/v2\/media\/10209"}],"wp:attachment":[{"href":"https:\/\/www.webii.net\/blog\/wp-json\/wp\/v2\/media?parent=401"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webii.net\/blog\/wp-json\/wp\/v2\/categories?post=401"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webii.net\/blog\/wp-json\/wp\/v2\/tags?post=401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}