WordPress Development Stack Exchange is a question and answer site for WordPress 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

OK so i am drawing a blank. I have setup a WordPress 3.1.2 Network site and want the main site to appear with www.mydomain.com not mydomain.com and i can get that to work but the back-end on the network admin breaks when i go to add a site it gives me the error "Are you sure you want to do this".

When i disable the redirect of non-www to www it works fine. I have setup the wp_options table with site home and url of www.mydomain.com so i do not get this at all. I had it working in 3.0 but now 3.1 not working

share|improve this question
up vote 1 down vote accepted

Where are you trying to do the force redirect? I think the best place for this may be in a .htaccess file. Something like

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.your_domain.com$
RewriteRule ^(.*)$ http://www.your_domain.com/$1 [R=301]
share|improve this answer
I have tried that and the network admin gets broken and if i redirect to www i need to tell wordpress that the main url is now www.mydomain.com or it will think that www is a sub-site – xLRDxREVENGEx May 3 '11 at 23:02
I'm assuming you've set your General Settings -> Site address and WordPress address to example.com? – BandonRandon May 4 '11 at 18:07
i have tried it both way's with my settings at www.mydomain.com and the rewritecode in .htaccess and domains at mydomain.com and the rewritecode in .htaccess – xLRDxREVENGEx May 4 '11 at 19:18
humm... I just had to change BOTH the url settings in my general settings and it worked like a charm. Try removing (or renaming/backup) your .htaccess file. Change your general URL settings and then regenerate permalinks. – BandonRandon May 6 '11 at 9:25

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.