I installed and set-up the Subdomain module on my live site. I would now like to go back to working locally. However, I'm finding that when I attempt to log-in all of the tabs on the .../user page point back to the live site's URL, not my local directory. Thus it tries to log me in the wrong site and I'm effectively locked out.
As far as I know the only place I entered the live domain into the site anywhere for it the remember was during the set up of the subdomain module... in the setting.php file to replace:
$cookie_domain = 'example.com';
How should I update this to work for my MAMP install. Just obvious does not work:
$cookie_domain = 'localhost:8888/directoryName';
Any thoughts?
Perhaps there is something I need to know about configuring MAMP for Subdomain to work?
Thanks!
Comments
Comment #1
setvik commentedhmm... i haven't tried it on a mamp install, so I'm not certain.
If anyone has any ideas, please comment.
Comment #2
Josephnewyork commentedsubscribe
Comment #3
rwohlebI have a few aliases setup in my hosts file that point to 127.0.0.1:
I then have my cookie domain set to '.localhost'. The cookie isn't shared between the subdomains properly so I'm not logged in across all of them, but it does rewrite the URLs correctly. The one downside with this technique is that I have to manually add an entry to my hosts file for each subdomain I'm testing.
I haven't had a chance to dig into what it would take to get the cookie to actually work properly. It would likely require using full domain names in the hosts file such as 'www.foo.com', or some other domain name that I'd never actually need to get to.
Comment #4
rwohlebI've come up with a better setup for doing subdomain development under MAMP that does not require messing with the hosts or apache config for each new subdomain.
First you need to install and configure DNSMasq via Mac Ports:
Next comes the Apache config magic:
Make sure that the default document root exists else apache will barf. Also make sure to substitue your username ;)
Now all of your subdomains will be served from "/Users/rwohleb/Desktop/WWW/%-3/docroot". This means that foo.example.com and www.foo.example.com will both be served from "/Users/rwohleb/Desktop/WWW/foo/docroot".
References:
1) The 'Setting up DNSMASQ' section from: http://davesouth.org/stories/how-to-set-up-dnsmasq-on-snow-leopard-for-l...
2) The 'NOW FOR THE APACHE MAGIC!' section from: http://postpostmodern.com/instructional/a-smarter-mamp/