HH-Steven

Well-Known Member
Aug 29, 2004
282
0
166
cPanel Access Level
Root Administrator

HH-Steven

Well-Known Member
Aug 29, 2004
282
0
166
cPanel Access Level
Root Administrator
webignition said:
I suppose you could try deleting the 'www' record from the zone file.
Thanks for the reply but that didnt work.

Is there any other ways of doing this? maybe using mod_rewrite in .htaccess or similar?
 

sparek-3

Well-Known Member
Aug 10, 2002
2,154
269
388
cPanel Access Level
Root Administrator
Try adding this to the VirtualHost section in the httpd.conf file (or I suppose the .htaccess file would work, never tried this in a .htaccess file though):

RewriteEngine on
RewriteCond %{HTTP_HOST} =www.domain.tld [NC]
RewriteRule ^ http://domain.tld%{REQUEST_URI} [R,L]


This should redirect traffic for www.domain.tld to just domain.tld
 

madaboutlinux

Well-Known Member
Jan 24, 2005
1,051
2
168
Earth
fs-uk said:
Ok, now this is going to sound very very weird but please bear with me.

I have one client who only wants his site accessible via http://domain.tld
he wants other methods such as:

http://www.domain.tld
&
www.domain.tld
to show error pages and hes used:
Cheers
Check whether there is 'ServerAlias' entry in the VirtualHost section in httpd.conf file. If present, remove the entry, restart httpd service and try.