Skip to content

Paul Scheinast

Feel free to copy, modify and share what you like.

Categories

  • C/C++ (2)
  • C# (2)
  • Fortran (3)
  • GNU/Linux Bash (24)
  • HTML,CSS,JS (25)
  • Java (4)
  • news (5)
  • Perl (79)
  • PHP (3)
  • Projects (5)
  • Regex (4)
  • Tips and Tricks (31)
  • Windows (1)

Top Pages

  • PERL
    • write fast code in Perl
    • Perl Tricks
    • default defined variables
    • Regular expression
    • Perl Graph
    • perl caller Debug Function
    • perl Data Dumper
  • GNU/Linux
    • Backtrack
    • HDparm
    • Mysql Cache tuning
    • Benchmark Your System
    • CPU Load
    • Core Themp
  • SEO

Pages

  • Image uploader
  • Impressum
  • partners

Archive

  • November 2016
  • February 2016
  • November 2015
  • June 2015
  • May 2015
  • April 2015
  • March 2015
  • February 2015
  • January 2015
  • December 2014

Recent Posts

  • Perl Regex named capture variables
  • Perl find all pow 2 numbers
  • Perl print String difference
  • Perl check if file handler is open
  • Perl print __DATA__ multiple times

Tag: redirect

php redirect to www

This shows how to make a php redirect from “url.com” to “www.url.com”.

if (substr($_SERVER['HTTP_HOST'], 0, 4) !== 'www.') {
    header('Location: '.$protocol.'www.'.$_SERVER['HTTP_HOST'].str_replace('//','/','/'.$_SERVER['REQUEST_URI']));
    exit;
}
Posted on March 27, 2015April 3, 2015Categories PHPTags php, redirect2 Comments on php redirect to www

Create a 301 Redirect to a new domain

If you change your Domain to a new you should make a redirect from the old to the new.In this case “http://scheinast.eu” is the new domain and on the old server we create a .htaccess file and put this text in:

Redirect 301 / http://scheinast.eu/
Posted on March 25, 2015April 3, 2015Categories Tips and TricksTags 301, htaccess, redirect1 Comment on Create a 301 Redirect to a new domain
Proudly powered by WordPress