1

I finally got around to using htaccess to properly redirect my www pages to non-www urls, but I can't seem to get it to work in any way I've tried. I believe something that was included in the htaccess before I changed it is causing the problem. I added

#www redirect RewriteCond %{HTTP_HOST} www\.(.+)$ RewriteRule (.*) http://%1/$1 [R=301]
in this http://pastebin.com/vAQ45Mky, but it seems to ignore it completely. My night spent searching for answers has turned up nothing useful, so thanks for any help you can give!

utopiated
  • 11
  • 1

1 Answers1

0

That's a big file, and I don't know what you've tested, but the first thing I'd try would be adding an L flag:

RewriteRule (.*) http://%1/$1 [L,R=301]

Without that flag, it'll keep trying the other rules, and apply those that hit. At which point I'm not sure if it is even defined what happens when first applying an absolute-URL rewrite, then (one or more) path rewrites, but I would not be surprised to see the hostname part of the first rewrite lost.

The Sidhekin
  • 283
  • 1
  • 2
  • 7