![]() |
DNS for www and non-www + index.php removal + Google Apps MX records - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: DNS for www and non-www + index.php removal + Google Apps MX records (/showthread.php?tid=30510) |
DNS for www and non-www + index.php removal + Google Apps MX records - El Forum - 05-17-2010 [eluser]Oskar Smith[/eluser] Hello all, This isn't really a Codeigniter question to be honest, but I was wondering if anyone could point me in the right direction for how to setup my DNS and htaccess for redirecting all www.mydomain.com/page queries to mydomain.com/page. I think I've got my htaccess about right, but can't get the DNS records working. I'm also using Google Apps for email. My DNS: Code: webmail CNAME ghs.google.com. And my htaccess: Code: RewriteEngine On The above doesn't work though, as visiting mydomain.com (no www) results in a "Can't find server" suggesting the DNS isn't correct. Do I need at @ record or something? Sorry, I'm afraid my DNS knowledge isn't up to scratch. I know this will be a common setup for many Codeigniter and ExpressionEngine users though, so guessing it's not hard to do. Any pointers appreciated. Thanks. *** EDIT: changed A record for webmail to CNAME - typo, sorry *** DNS for www and non-www + index.php removal + Google Apps MX records - El Forum - 05-17-2010 [eluser]cahva[/eluser] In dns you should have something like this: Quote: MX 1 ASPMX.L.GOOGLE.COM.I dont know which DNS system you are using or how much control you have but if you manage to do it like this, it should work. BTW, if you have "webmail A ghs.google.com." thats definately wrong. For A records you can put only IP-addresses. For hostnames, use CNAME. DNS for www and non-www + index.php removal + Google Apps MX records - El Forum - 05-17-2010 [eluser]bretticus[/eluser] DNS is usually not handled by the programmer. Is this a custom server you have setup? If so, and you are using Bind (which is very common) your zone record should look similar to: Quote:$ORIGIN . DNS for www and non-www + index.php removal + Google Apps MX records - El Forum - 05-18-2010 [eluser]Oskar Smith[/eluser] Thanks for your replies cahva and bretticus. Firstly, apologies, that was indeed a typo in my post - webmail was indeed CNAME, I just typed it wrong in my post. Now corrected. @bretticus - sorry, should have said, I'm making these DNS settings with my registrar, 123-reg, as opposed to on my own server. @cahva - I've added that extra [ mydomain.com. A my.ip.address ] line but it's still giving me a Failed To Open Page message when I visit mydomain.com (but it's fine when I visit www.mydomain.com). I wasn't sure what the $ORIGIN record was for though, and I don't see any option in the 123-reg DNS control panel to allow such a record to be added. I'm guessing it's the mydomain.com record as above that's the important part though? Any other suggestions would be very welcome, thanks. DNS for www and non-www + index.php removal + Google Apps MX records - El Forum - 05-18-2010 [eluser]cahva[/eluser] When you change DNS settings, the change wont be realtime. It depends what TTL is set(TTL can be set different for all the records). With that said, I took a peek at 123-reg help and it says it takes 24-48h for the changes to take effect. Also in their help they say: Quote:The @ record relates to the blank A record for the domain with nothing before it i.e. yourdomainname.co.uk. So it seems you can set the A record for base host name with @. DNS for www and non-www + index.php removal + Google Apps MX records - El Forum - 05-18-2010 [eluser]Oskar Smith[/eluser] Thanks cahva, yes I suppose it is possible I'm being impatient with the DNS propagation (I've always found that the changes take effect much faster than 123-reg's advertised 24-48hrs, but I suppose I can't take that for granted and should give it a chance...!) Thanks for the @ tip though - I thought it could be something like that from Googling around. OK, I'll give @ - A - ip.address a go and give it a bit longer and see if that works. Thanks again. DNS for www and non-www + index.php removal + Google Apps MX records - El Forum - 05-18-2010 [eluser]Oskar Smith[/eluser] Success! It's now working correctly - there was a couple of issues being compounded. The DNS changes in 123-reg were getting applied pretty quickly, but I forgot that I had my laptop's DNS servers pointed at my (rubbish) default ISP ones rather than the quickly updated Google Public DNS that I normally use on my desktop. So updating those meant I started seeing the DNS changes straight away. So for anyone else looking to do this, I can confirm that your registrar's DNS should be; Code: webmail CNAME ghs.google.com. And your htaccess should be: Code: RewriteEngine On That works for me anyway. |