6

I'm trying to do domain mapping on my site in the fastest possible way so I've searched for PHP plugins that I can possibly use. However, all results are Wordpress-related. I'm using Cakephp 2.4. Is there an available plugin for this that is not WP? If not, how can I make use of the WP plugin to make it work in Cakephp?

[EDIT] For example, if I have a public page on someonessite.com/myname and I want mysite.com/me to redirect or map the former site then I'll have to set something on someonessite.com so that mysite.com/me will display someonessite.com/myname via domain mapping.

[NEW EDIT] So, I want to map mysite.com/me (my own site) to the IP address of someonessite.com/myname (someone else's site that I have account at and where I want to add this php code to)

eg. I will save my own/customized site (mysite.com/me) at someonessite.com and let someonessite.com map my own site to their IP address to display someonessite.com/myname

Leah
  • 225
  • 2
  • 10
  • 24
  • Does it need to be a plugin? Are you handling multiple domain rewrites or a one-off rewrite from _italic_mysite.com/me_italtic_ to _italic_someonessite.com/myname_italic_? – Patrick Lyver Nov 15 '14 at 14:24
  • It doesn't need to be a plugin.. I'm not really sure where or how to start.. I just thought a plugin will make it easier and faster to develop.. This is for multiple domains since any user on someonessite.com who wished to have a custom domain can do so.. @PatrickLyver – Leah Nov 16 '14 at 08:16
  • willing to pay $5 to whoever can help out @PatrickLyver – Leah Nov 16 '14 at 10:27
  • So to get this straight, mysite.com/me is actually mysite.com/user which needs to point to any other URL that the user wishes? – Patrick Lyver Nov 17 '14 at 03:32
  • Yes, something like that. Or you can just use plain mysite.com to point to the ip address of anothersite.com where i'm planning to put the code to .. http://www.quora.com/How-can-I-do-domain-mapping-on-CakePHP-like-the-WordPress-Domain-Mapping-plugin @PatrickLyver – Leah Nov 17 '14 at 07:00
  • Do you have access to the other website's server configuration? The server on anothersite.com will need to handle most of the routing. Or you'll have to use iframes. – Patrick Lyver Nov 17 '14 at 12:22
  • Yes, I have access to anothersite.com's server configuration since this is the site I'm trying to develop. @PatrickLyver – Leah Nov 17 '14 at 12:32
  • Yes, I'm using cakephp for anothersite.com @PatrickLyver .. The other sites used by the users may not be cakephp since what's important is for them to be able to map their own domain only.. – Leah Nov 17 '14 at 15:03
  • Will this help? http://stackoverflow.com/questions/9440193/cakephp-multisite-like-wpmu-domain-mapping-possible – Patrick Lyver Nov 17 '14 at 16:40
  • that is not for domain mapping.. if you can see on one of the comments below the answer, i clarified that it's for multisite only, not for domain mapping.. :( @PatrickLyver – Leah Nov 17 '14 at 17:04
  • If i understand, you want that "site.com" see what is on "anothersite.com" ? Do they are in the same server ? – MouradK Nov 19 '14 at 13:12
  • They are not on the same server. Yes, I want site.com to display anothersite.com with site.com's url still. @MouradK – Leah Nov 19 '14 at 15:07
  • If your dns of site.com point to the ip of anothersite.com , and you modify your vhost , it will be ok ! can you modify them ? – MouradK Nov 20 '14 at 09:02
  • Yes, but will that only make it redirect to the page? How do I display it on the URL though? Some said it can't be done by URL rewriting since it's replacing the domain name as well, not just the parameters. This is really what's confusing me. @MouradK – Leah Nov 22 '14 at 08:52

2 Answers2

1

You are not very clear on what you want, but at a guess it looks like you need this

You can use that plugin to set up different configs based on what domain is loaded. I use it for that use case also.

dogmatic69
  • 7,574
  • 4
  • 31
  • 49
  • What do you mean by "based on what domain is loaded"? – Leah Nov 13 '14 at 08:58
  • The domain in the headers of the request. EG: you have site1.com and site2.com both running off the same code base but have different config for each. – dogmatic69 Nov 13 '14 at 09:54
  • different config? like what exactly? because what i'm trying to do is if I have my own domain (eg. mine.com) and I want to point this to another site's ip address (eg. another.com) so that it shows mine.com on the url but showing another.com's content, is that possible? – Leah Nov 13 '14 at 11:54
  • do you know someone else who knows about this? i'm willing to pay $5 to whoever can help out – Leah Nov 16 '14 at 10:27
0

On mysite.com/me

use

<?php
/* Redirect browser */
header("Location: http://someonessite.com/myname");


exit;/* Make sure that code below does not get executed when we redirect. */
?>
Confused
  • 1,602
  • 15
  • 25
  • no, this is just a simple redirection.. there's nowhere in this code that will make mysite.com appear on the url – Leah Nov 20 '14 at 08:36