Applicable to:
- Plesk 11.x for Windows
- Plesk 12.0 for Linux
Symptoms
After upgrade to Plesk 11.5, domains are redirecting to the URL
'www.domain.com'
, even if addressed without
'www'
in browser.
Cause
This is caused by the new
Preferred Domain
feature, which is set to
'www.'
by default for all installations.
Resolution
In order to switch off the feature, please follow either of the following instructions depending from your OS:
For Windows
-
Run following command to retrieve list of domains with enabled SEO Redirect (it will require Plesk Panel admin password):
"%plesk_dir%"\\mysql\\bin\\mysql.exe -uadmin -p -P8306 psa -Ne"select d.name from dom_param dp,domains d where dp.param='seoRedirect' and d.id=dp.dom_id and dp.val in ('www','non-www') order by d.id" > C:\\seo_dom_list.txt
-
Create a
C:\\seo_update.bat
file using Notepad and add following lines there:@echo off
for /f %%i in (c:\\seo_dom_list.txt) do ( echo %%i
"%plesk_cli%\\subscription.exe" -u %%i -seo-redirect none) -
Launch the script file.
C:\\seo_update.bat
sub1.tld
SUCCESS: Update of domain 'sub1.tld' completed.
sub2.tld
SUCCESS: Update of domain 'sub2.tld' completed.
For Linux
-
Run following command by root or a user with root privileges:
MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin -Dpsa -Ne"select d.name from domains d, dom_param dp where d.id=dp.dom_id and dp.param='seoRedirect' and dp.val in ('www','non-www');" |while read i;do /usr/local/psa/bin/subscription -u $i -seo-redirect none;done
SUCCESS: Update of domain 'sub1.tld' completed.
SUCCESS: Update of domain 'sub2.tld' completed.
Related articles
In order to disable the Preferred Domain for all newly created domains, please follow this article:
Comments
0 comments
Please sign in to leave a comment.