Drupal Answers is a question and answer site for Drupal developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I put the following code in my .htaccess to redirect the URL with www to the one without.

  # To redirect all users to access the site WITH the 'www.' prefix,
    # (http://www.example.com/... will be redirected to http://example.com/...)
    # adapt and uncomment the following:
    RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
    RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]

The redirect works correctly. However now some users start reporting me that they get the following error on node creation when they try to save the node.

Validation error, please try again. If this error persists, please contact the site administrator.

After reading the answer to this quetion I'm guessing it's a session issue. (Please correct me if I'm wrong).

My question is do I need to add something else in .htaccess along with the code above?

share|improve this question
Are you setting the base url and the cookie domain in your settings.php? If so, make sure they don't have the www. – MPD Nov 24 '12 at 15:36
No I haven't done anything with settings.php. Do I need to set cookie domain in .htaccess? – chinita7 Nov 24 '12 at 17:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.