1

I am working on one cakePHP application. Now i want to configure my main domain (www.example.com) to be accesses via 'www.xyz.com' or 'www.bcd.com'. For this i will add the CName record in the 'www.xyz.com' or 'www.bcd.com' as 'www.example.com' then xys.com & bcd.com will point to the example.com.

But now on the xyz.com & bcd.com i can see the content of example.com, but whenever i click on any link it gives me 'URL NOT FOUND' Error.

So i tried lots of .htaccess rules but it is not working.

It is similar to the bloggers custom domain pointing. I need the same thing to be applied for my application.

Can anybody tried this before?

Vijay Kumbhar
  • 896
  • 1
  • 13
  • 31
  • 1
    Do you want the site to be accessed from different domains or redirect all different domains to one domain? – Virendra Dec 25 '11 at 11:11
  • Hey, i need only access, not redirection. My main hurdle is .htaccess rules in cakephp, i am not getting how do i apply rule for this in htaccess. – Vijay Kumbhar Dec 25 '11 at 11:12
  • So you want the same site to be accessible from multiple domains? – Virendra Dec 25 '11 at 11:17
  • Well, as far as I know this is a bad idea, because you are creating duplicate content and also loosing the SEO and page rank for the same page to multiple domains. So I would suggest you redirect all the different domains to your main domain and the site be accessible only from one domain. I have not tried your requirements before. Let me try out and get back to you. – Virendra Dec 25 '11 at 11:21
  • You can host all the domains on same server and create virtual hosts for each domain to point to the same file system and database. – Virendra Dec 25 '11 at 11:24
  • Thank you Virendra... You are right, i referred lots of documents about this. But I am working on a SAAS base app where i want my users can add their custom domains & point them to their application created on my SAAS based app. – Vijay Kumbhar Dec 25 '11 at 11:25
  • I am not very sure but may be you can do something like this If the users can have sub-domains on the main domain (e.g. Abc.domain.com, xyz.domain.com). Allow your server to serve the content to your main domain as well as any sub-domains. Then based on the sub-domain and probably a linking of the sub-domain with user in database you can display custom data to the user. – Virendra Dec 25 '11 at 11:31
  • We are doing the same currently, but we need to provide custom domain support. If any user adds his domain (user.com) & add the CName of our app to his domain. Then the user.com can serve the user content from our domain. – Vijay Kumbhar Dec 25 '11 at 12:04
  • duplicate of: http://stackoverflow.com/questions/8617302/htaccess-rewrite-to-sub-domain/8617440#8617440 – Gerben Dec 25 '11 at 17:09
  • Thanks, But i dont need to direct the subdirecories. I have SAAS base application & where www.abc.com pointed to www.example.com should show the same content on www.example.com – Vijay Kumbhar Dec 26 '11 at 16:17

1 Answers1

0

This isn't entirely an .htaccess issue - you need to first edit the server name in your web servers configuration file to serve not only example.com, but also requests coming in from xyz.com and bcd.com.

Shaz MJ
  • 1,785
  • 1
  • 12
  • 25
  • But this is the SAAS base application & for how many domains i will edit the config file on my web server? It is not a feasible way to tackle this issue. – Vijay Kumbhar Dec 26 '11 at 16:11