• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Redirect www.[name].com domain to [name].com domain

O

open4biz

Guest
When I set up my domains in Plesk, I set them up so they did not need the www in front of the domain name (i.e. www.mydomain.com).

Now I would like to make it idiot proof and send the user that mistakenly types www to the www-less domain name. Would you do that with the DNS setup section of the domain control panel?

I set up cname records for all three of my domains (www.blah.com automatically goes to blah.com)... but the third doesn't seem to be working. Which got me to thinking, did I do it correctly? Is that the technically correct way? Or should I use a redirect script?

Any help would be appreciated. :p
 
.htaccess file

Try using an .htaccess file using the following paramaraters.


# permanently redirect from www domain to non-www domain
RewriteEngine on
Options +FollowSymLinks
RewriteCond %{HTTP_HOST} ^www\.INSERTDOMAINNAMEHERE\.com$ [NC]
RewriteRule ^(.*)$ http://INSERTDOMAINNAMEHERE.com/$1 [R=301,L]

# redirect a specific file via 301
redirect 301 /INSERT_URL_HERE.html http://INSERTDOMAINNAMEHERE.COM

#save this file as .htacess
#in your httpdocs file it should then
#redirect to the domain of your choice.

-Chris
 
Try using an .htaccess file using the following paramaraters.


# permanently redirect from www domain to non-www domain
RewriteEngine on
Options +FollowSymLinks
RewriteCond %{HTTP_HOST} ^www\.INSERTDOMAINNAMEHERE\.com$ [NC]
RewriteRule ^(.*)$ http://INSERTDOMAINNAMEHERE.com/$1 [R=301,L]

# redirect a specific file via 301
redirect 301 /INSERT_URL_HERE.html http://INSERTDOMAINNAMEHERE.COM

#save this file as .htacess
#in your httpdocs file it should then
#redirect to the domain of your choice.

-Chris

Hi 64bithost.com, I am struggling to get this to work. I have tried various methods ref. :http://forum.parallels.com/showthread.php?t=88372

Are you able to offer any suggestions?

DM.
 
Back
Top