MyBB Community Forums

Full Version: .htaccess www redirect
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hey Guys

So I am using a www .htaccess redirect for my website and for some reason when I try to visit the blog (which is a subdomain) it is putting the www. in front of that and putting the subdomain extension at the end.

It should be:
http://blog.socialdisease.net
However it is coming out as
http://www.blog.socialdisease.net/blog

Rendering it completely unusable.

Any ideas?

RewriteEngine on 
RewriteCond %{HTTP_HOST} ^socialdisease\.net 
RewriteRule (.*) http://www.socialdisease.net/$1 [R=301,L]
Where did you put the .htaccess?
/public_html/
I'm now trying to set up the iPhone Redirection and I'm getting a Too Many Redirects Error :/
LOL, when I got to http://blog.socialdisease.net it takes me to http://blog.socialdisease.net/blog/blog/...blog/blog/
But I'm not sure, I've used that code you used and it worked fine for me.
I've always found the www. redirect really unstable. It works fine on some hosts, but not others for some reason.
(2011-04-30, 07:17 AM)euantor Wrote: [ -> ]I've always found the www. redirect really unstable. It works fine on some hosts, but not others for some reason.

Probably due to apache settings. Normally setting the root corrects issues.
Try this instead:

Options +FollowSymlinks
RewriteEngine on
Rewritecond %{http_host} ^socialdisease.net [NC]
Rewriterule ^(.*)$ http://www.socialdisease.net/$1 [r=301,NC]
Thats a www to nonwww redirect >_>
Sorry, posted the wrong one.

Edited.
That worked. Thanks.
Pages: 1 2