Reputation: 1526
I have a cakephp 2.3.5 installation with this structure:
/root
../CakePHP
..../Cake_core_files
..../apps
....../my-app
......../app
........../Config, /Controller, /View, etc
..../public_html
....../my-app-webroot
......../css, /img, etc
Now I would like this same app to be able be accessed with 2 different domains:
Using the default CakePHP's htaccess this setup works fine for mydomain2, but for mydomain1 it only works for the initial page, any other link inside the website returns a not found error.
For example, with mydomain1, accessing mydomain1.com/my-app-webroot shows the initial page fine, but if I click on a link like mydomain1.com/my-app-webroot/mycontroller/somepage then it can't find it. However, if I go to mydomain2.com/mycontroller/somepage then it works fine.
Note: in the routes file I have the '/' connected with 'mycontroller/index'.
Any ideas on how can I achieve what I want?
Upvotes: 0
Views: 242
Reputation: 189
Create rewrite rules in the .htaccess in your hosting packages, based on the fact that you told that the domains are pointing to your hosting. The second domain, is that an add-on or parked one? If one domain is an add-on domain this might be your problem. Add-on domains works independently! Well at least in our hosting servers. Hope that helps to find your problem.
Upvotes: 1
Reputation: 424
There are 2 parts to pointing all the domains to the same website. One part involves changing the settings at your domain name registrar. The other part requires you to get your web host to add those additional domain names to your account. It probably doesn't matter which part you do first (unless your web host is fussy), but you'll need to get both done.
For more Detail you can go to this website http://www.thesitewizard.com/domain/point-multiple-domains-one-website.shtml
Upvotes: 0