I had been wondering why I hadn’t had any comments between Sunday and Tuesday. I posted enough posts that surely some of you must have tried to comment … at least on my Green Thumb Sunday post. Didn’t you?
Early Sunday morning I put some code in this sites Htaccess file that would create a 301 redirect so that all pages on this site would go to an url with www in the address. It didn’t work well when I just put the code in, so I went to the options area in my blog and changed the blog directory address so that it had a www in the url.
That worked. Ta Da .. when I visited any page on my site the url had www in it. I wanted it that way because this site is a PR5 when the www is in the url, so to consolidate all the links to my site that are out there – some with www and some without I wanted to force the www.
What I didn’t realize was that if someone was visiting an url on the web that had been listed without the www they were automatically sent to the index.php page of this site.
I also just discovered that when I wanted to comment on one of my own posts that it just came up with a blank page when I hit submit. Did you guys encounter that too? Or were you ignoring me for the last couple of days.
Tell the truth, I promise I won’t be hurt if you ignored me.
So I guess I need some help. What I’ve tried to do on my own didn’t work. Julie tried to help me for quite some time last night but the codes she gave me to try didn’t work either. I contact my webhost support and they say “they don’t help people with scripts”. Hmmm nice.
I want this sites url to include the www so I need to do a 301 redirect. Anyone want to give me Htaccess codes that I can try? Please. What I was using didn’t work obviously.
Also, do I need to change anything in my blogs configuration? Maybe my mistake was adding the www to the blog address in the wp dashboards option area? But the code I tried didn’t work without me doing that.
One more thing … if you are a 301 redirect htaccess wizard … what code would I use for our other blogs that are listed as mydomain.com/blog I’ve tried to figure out an htaccess code for them that sets it so that they do NOT have the www in their urls, but I can’t figure that one out. Everything I’ve tried fails.
Help!
Oh and with the minor changes I made my wordpress wasn’t adding new categories anymore either. I only changed the two things that I mentioned. I couldn’t have messed things up that badly could I have?
Keiron says
Hi Tricia,
I did this months ago and can’t find it now, but try this:
# redirect all non-www traffic
RewriteCond %{HTTP_HOST} ^somedomain.com$
RewriteRule ^.*$ http://www.somedomain.com%{REQUEST_URI} [R=permanent,L]
Captain Lifecruiser says
Ooops…. Yes, I also had a blank page when trying to reach you earlier, but I only thought that you had temporary problems, so I never emailed you about it, dumb enough.
I’ve no idea about the htaccess-problem, but if I stumble over something I’ll let you know.
About the add of new category-problem: I’ve heard it before, Racquel got that problem after upgrading WordPress, but I have no idea if she got it solved or not.
John Hunter says
It is working now right? If not show what the code is that you added. I posted this on a page without the www .
Tricia says
John no, I couldn’t get an htaccess code to work to make this sites urls all show up with www in the url. ๐ I think I’ve tried it at least 20 different ways. My webhost won’t help me as they say they offer very little support for “scripts”. I did ask them if redirects are allowed on their servers and they said yes but it’s pretty odd that I can’t get anything to work.
If you have any ideas I’d love to hear them. ๐
Cynthia Blue says
Yikes! ๐ I’m glad you got it worked out. I don’t know much about the htaccess file either.. but am learning.
Tricia says
Oh no Cynthia my htaccess problem isn’t worked out at all. I gave up!
John Hunter says
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]
Does that work for you?