• 301 Redirects with Plesk

    by  • January 8, 2009 • hosting, htaccess • 5 Comments

    I’ve just recently signed up with a new web host (Weycrest) to take over the hosting of my blog, and they utilise the Plesk control panel for administering the thing. I was with Dreamhost before and I had created several sub-domains of paulkiddie.com that act to redirect to another page but I couldnt for the life of me find any option within the manage sub-domain settings to do a redirect from the sub-domain to another website.

    I found a great article at http://dannynsl.blogspot.com/2007/08/redirecting-in-plesk.html, which explains how can do just that, and it’s pretty simple! You just create a .htaccess file and put it in the httpdocs folder of the subdomain, that looks something like this:

    RewriteEngine on
    RewriteCond %{SERVER_NAME} subdomain_address_here [OR]
    RewriteCond %{SERVER_NAME} www.subdomain_address_here
    RewriteRule ^.*$ redirect_address_here [R=301]

    Just fill in the entries for

    subdomain_address_here

    and

    redirect_address_here

    and you’re good to go! Got a 301 redirect going, so I’m happy!

    About

    .NET developer at thetrainline.com, previously web developer at MRM Meteorite. Awarded a PhD in misbehaviour detection in wireless ad-hoc networks.A keen C# ASP.net developer bridging the gap with APIs and JavaScript frameworks, one web app at a time.

    http://www.paulkiddie.com

    5 Responses to 301 Redirects with Plesk

    1. May 1, 2009 at 11:03 am

      Thanks for this; it worked for me but only after adding http://
      I changed
      RewriteRule ^.*$ redirect_address_here [R=301]
      to
      RewriteRule ^.*$ http://redirect_address_here [R=301]

    2. Affordable Web Desig
      September 30, 2010 at 7:14 pm

      Is it also work in windows server running plesk control panel. We’ve a site hosted in windows server with plesk and running coldfusion file.

    3. November 25, 2011 at 8:17 am

      Dear all,

      I have also encountered this problem in Plesk. My solution was to create an alias domain for the main one, else it will not 301 redirect just by setting up .htaccess this way. (plesk will assume that www. versus non-www are separate virtual directories. Also if you set it up separately, and create a .htaccess file in the main domain, and 301 redirect it to the www one, Google will not cache the index page. I couldn’t find any answer to this issue, so probably this is the best solution. (if you leave your main directory empty, with just the .htaccess, is not good.

      Lori

    4. December 16, 2011 at 12:18 pm

      Great article it did the trick for me!

    5. September 14, 2012 at 1:05 pm

      I think tom is correct – a http is needed. Al alternative to .htaccess is to create a vhost.conf file in the conf subdirectory of the domain.

    Leave a Reply

    Your email address will not be published. Required fields are marked *