Hi,
I have a Rails+Apache+Passenger setup and my app serves wildcard subdomains. I need all www URLs to redirect to their non www equivalents.
- www.example.net should redirect to example.net
- www.subdomain.example.net should redirect to subdomain.example.net
My current vhost config is as below
<VirtualHost *:80>
ServerName example.net
ServerAlias *.example.net
DocumentRoot /home/public_html/example.net/current/public
RailsEnv staging
</VirtualHost>
I tried an assortment of rewrite rules in various locations but none took effect. I've checked to make sure that the apache rewrite module is enabled and RewriteEngine is on. Not sure what I'm missing. All help much appreciated!