www to non-www redirect problems


I'm trying to redirect www to non-www versions of my Omeka site.

I've added the following to my .htaccess file:

RewriteCond %{HTTP_HOST} ^www\.cornishmemory.com$ [NC]
RewriteRule ^(.*)$ http://cornishmemory.com/$1 [R=301,L]

This sort of works, but URLs don't work as I'd hoped.


should redirect to


but it actually redirects to


..which results in a 404 - /item is stripped from the URL and index.php is added.

Otherwise my .htaccess is Omeka's default.

Does anyone have any suggestions to fix this?



Where do you have those lines, above or below the "stock" rewrite rules?

Hi John,

Thanks for replying - they're below the rewrite rules.

What happens when you move them above, so this is the first rule rather than the last?

Aha - that works - so simple. Thank you!