Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

Remove www for urls

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
3 posts • Page 1 of 1
dananimal
Posts: 6
Joined: Thu Feb 19, 2015 12:24 pm

Remove www for urls
  • Quote

Post by dananimal » Sat Feb 21, 2015 9:33 am

What is the correct way in vestcp to redirect requests for www.example.com to example.com?
Top

patstan
Posts: 117
Joined: Wed Jul 30, 2014 10:53 am

Re: Remove www for urls
  • Quote

Post by patstan » Sat Feb 21, 2015 9:47 am

You can use .htaccess
Top

dananimal
Posts: 6
Joined: Thu Feb 19, 2015 12:24 pm

Re: Remove www for urls
  • Quote

Post by dananimal » Sun Feb 22, 2015 7:49 am

Thanks, that's perfect.

If anyone else needs to do this in .htaccess in the web root directory:

Code: Select all

RewriteEngine on
# remove 'www.' from URLs
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1%{REQUEST_URI} [R=301,QSA,NC,L]
Top


Post Reply
  • Print view

3 posts • Page 1 of 1

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password