I’ve had a problem with some of my blogs in the past month and a half or so. When I first set up a few of my blogs on my feverishthoughts.com domain I didn’t create sub-domains. Instead I created the new blogs as directories within the feverishthoughts.com domain.
So instead of my gardening blog being located at garden.feverishthoughts.com it’s located at feverishthoughts.com/garden/. It wasn’t my smartest move, but that’s not my current problem. I’ve purchased new domains for some of the directory blogs and I’ll eventually move those blogs to their own domains once the new domains have gained some page rank.
The problem that I’m having is that about a month and a half ago I noticed that some of my directory domains – not all of them, just half – are acting up. If you visit the site and include the backslash at the end of the address the url works properly, but if you don’t include the slash at the end or if you click on the header or a “home” button the new site url will contain my primary domain url in it as well.
One of the sites that is doing this is my husbands blog Odd Planet. If you visit the site as I’ve just listed the url it looks fine, but click on the Odd Planet logo on the upper left hand side of the page and the url comes up as:
http://feverishthoughts.thewebfiles.com/oddplanet/
Thewebfiles.com is the primary domain on my hosting account. Feverishthoughts.com and my other domains are addon domains.
On my main Feverishthoughts website – Tricia’s Musings, I have a 301 redirect code in my htaccess file that places the www in the url as my site has higher PR if the www is in the url. However, all the rest of the the blogs on that domain have higher PR if there is no www in their url so I’m using a nowww wordpress plugin to redirect those urls.
Trouble is that the plugin doesn’t seem to be working lately. Hmm maybe I should try re-installing that plugin. The current copy might have been damaged in all the server transfers my sites have gone through lately. I doubt that’s the problem, but I’ll give it a try.
The htaccess file on my primary domain Thewebfiles.com only contains the coding that WordPress places in it and nothing else.
The htacess file that I’ve altered in the root of feverishthoughts.com contains:
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.|$) [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
The section that I bolded is the portion of the code that redirects to www, the rest of the coding is placed there by WordPress when it is first installed.
I placed that code in the feverishthoughts.com htaccess in mid-May and all my directory related blogs under feverishthoughts.com were working fine.
I believe it was mid-June when I noticed that some of my directory blogs had thewebfiles.com in their urls under certain circumstances. I don’t believe I added any plugins or altered any code during this time period.
The problem might not have occurred in mid-June as I believe it did though, it might have occurred after June 26th when Lunarpages moved my whole account to another server when they stated that I was having CPU resource issues. They then moved my account again temporarily to a VPS server on July 23rd after they’d suspended my shared hosting account. Read my CPU Resource issue problems or my story about changing hosts if you need to catch up on that issue! (I’ll be posting a more detailed story about my issues with Lunarpages tomorrow)
I’ve since moved to HostGator (July 23rd) and they did a full c-panel back up for me of my Lunarpages account so I believe whatever issues I had with my subdomain or directory blog setting on Lunarpages have followed me to Hostgator.
Does anyone have any idea as to how I might resolve this issue? Perhaps a 301 redirect to the proper url for the blog in each directory blogs htaccess file? If so – can you please give me a 301 direct code that might work with a mydomain.com/blog/ blog?
I’ve found that it’s hard to find htaccess codes that work properly with directories. That’s one reason why I’ve ended up using a nowww wordpress plugin on those blogs since I couldn’t find a proper htaccess code to exclude the www from my directory blogs.
Other things that I’ve thought of that could be the cause of the problem:
1. The way my domains were added on to to my account?
2. A problem in the mySQL database for the few sites that are having this peculiar problem.
3. A problem with the themes I’m using? (least likely …)
4. The httaccess code that I’m using in the root of feverishthoughts.com
5. the nowww wordpress plugins that I’m using in the directory blogs to keep www out of the url.
Any ideas? I really need to resolve this issue because the search engines are starting to index my sites with the strange url now too.
JasonJ says
Wow, that is strange. I tried it for myself… bizarre.
I clicked around on Odd Planet and the only way I got to that strange URL was through the logo. All the other paths (i.e. post, comments, about, sitemap, etc) were normal. Maybe you should just disable the logo and make the Blog title a link back to the main page.
ann says
rewire this line
{REQUEST_URI} [L,R=301]
to this
{REQUEST_URI} [R=301]
the L tell the server that it is the last line in the .htaccess
Black Hattitude says
I have the same problem, and I tried what is in the answer but doesn’t work!