301 Redirects with Plesk
by Paul Kiddie • January 8, 2009 • hosting, htaccess • 4 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!
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]
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.
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
Great article it did the trick for me!