Hi all

I've searched everywhere on the internet including Daniweb for this answer but I can't find one.

I don't want to break the rules, so I've changed the real domain name to domain.co.uk

I manage a website www.domain.co.uk where the owner requires a subdomain called quotes.domain.co.uk

He then needs the quotes subdomain to reroute to a third party site.

So I've logged into the cPanel, set-up an A DNS record (called quotes) and great, it reroutes.

But I've discovered that if I enter www.quotes.domain.co.uk it doesn't reroute through to the third party site. Instead, I receive:
in Google Chrome, the "Oops! Google Chrome could not find www.quotes.domain.co.uk" error page.
In Opera it gives a "Network Error" error page.
In Firefox a "Server Not Found" error page.

So now I need to have the www version of the sub-domain redirect to the non-www version; i.e. http://www.quotes.domain.co.uk redirects to http://quotes.domain.co.uk

I've tried several different .htaccess solutions, which I won't bore you with here; suffice to say that none of them have worked.

Please can anyone help me to resolve this?

Thanks

Rob

Recommended Answers

All 2 Replies

Member Avatar for diafol

do you have cPanel? If so, there should be a redirect option which should give you what you need.

else:

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^/(.*)$ http://%1/$1 [R=301,L]

Ensure that you've got RewriteEngine On If you have access to httpd.conf, you could do this:

<VirtualHost *>
  ServerName www.domain.co.uk
  Redirect 301 / http://domain.co.uk/
</VirtualHost>

However, I haven't tried it. I'm no expert on .htaccess, so take my advice with a pinch of salt. Anybody else?

Hi ardav - thanks for your advice. I had a sudden realisation though that actually both the updates.domain.com and the www.domain.com are subdomains...so the www.updates.domain.com doesn't actually exist!
But thank you so much for your time in answering this. If I am wrong on this though, it would be great for someone else, or yourself, to jump in and correct me. Or you can leave me in blissful ignorance!
Cheers

Rob

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.