• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Domain forwarding with htaccess

coolemail2

Basic Pleskian
I have re-built a website on a new domain. Now I want to redirect http://www.olddomain.com/anything or http://olddomain.anything to www.newdomain. Because the file structure is totally different, I want all redirections to go to the Home Page of newdomain.

Initially, I used Standard forwarding in the Plesk CP but that attempts to keep the filename the same. So www.olddomain.com/wibble tries to go to www.newdomain.com/wibble. But wibble dies not exist on the new domain.

Should I use htaccess with physical hosting instead on olddomain.com? Is the following correct?:

Code:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^olddomain.com [NC]
RewriteRule ^(.*)$ http://www.newdomain.com [R=301,L]

Will that basically cover any request? Anything that people have saved or which appears in Google searches, no matter whether http:// or http://www.

And for neatness on the new domain, I would like to add www to any request like http://newdomain.com/whatever to go to http://www.newdomain.com/whatever which I think means that Google analytics will report more accurately.

So would my htaccess file on newdomain.com be like this?:

Code:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^newdomain.com [NC]
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L]

Many thanks, in advance for any help.
 
.htaccess on newdomain not working

In newdomaon.co.uk I have created a .htaccess file and put the following:

Code:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^newdomain.co.uk [NC]
RewriteRule ^(.*)$ http://www.newdomain.co.uk/$1 [R=301,L]

and when I go to http://domain.com it does not resolve to anything and I get told "This page can't be displayed. Make sure the web address http://newdomain.co.uk is correct."

What have I done wrong there? And I'd still welcome the advice on what do do for the olddomain redirection please.
 
I am delighted to say that for an olddomain.co.uk where we want to forward EVERYTHING to the Home Page of newdomain.co.uk, the following worked:

1. Change it from a standard forwarding account to a physical hosting account
2. Create a .htaccess file with the following in that file:
Code:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^olddomain.co.uk [NC]
RewriteRule ^(.*)$ http://www.newdomain.co.uk [R=301,L]

Now, if anyone can help me identify how to add www to any non-www request, I would be most grateful. This is what I am using to try and achieve redirecting http://mydomain.co.uk/ to http://www.mydomain.co.uk/. It should also work if an individual file is requested, such as http://mydomain.co.uk/file.html

Code:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^mydomain.co.uk [NC]
RewriteRule ^(.*)$ http://www.mydomain.co.uk/$1 (L)

but what I get is:
HTML:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator to inform of the time the error occurred and of anything you might have done that may have caused the error.
More information about this error may be available in the server error log.

In the error log I am getting:
[Mon Jun 16 17:06:38 2014] [alert] [client 109.224.207.33] /var/www/vhosts/mydomain.co.uk/httpdocs/.htaccess: RewriteRule: bad flag delimiters

I do hope someone can help with that.
 
Back
Top