RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L] RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]You can't use a CNAME record for your root domain. This is a problem for me and lots of folks who run their web servers behind Amazon Elastic Load Balancers or other CNAME-based services. RootRedirect solves the problem nicely.
Amazon Route 53 solves this problem with an alias record, though your service may be easier to use or cheaper than what Amazon offers.
server {
server_name example.com;
rewrite ^ http://www.example.com$request_uri? permanent;
}I need to track link clicks made on advertisements in our iPad app. I can't do it from the app because 1) our backend is open source, and they're not implementing that and 2) I don't know how anyways.
So I thought of using redirects. The link in the app goes to our site and gets redirected to the advertiser's site. That way I can track it with Google analytics and since i understand that, everything is peachy.
Therefore, the questions are: 1) is this an acceptable practice? and 2) is there a better, easier way that I'm unaware of?