PDA

View Full Version : How Do I Include 'www' In My Blog Domain?


dandan
02-12-2009, 05:18 AM
Hi,

May I know how do how do I include 'www' in my blog which is the subpage of my website? My current address is http://domain.com/blog, how to change to http://www.domain.com/blog? I'm using hostgator. I understand that we need to modify the .htaccess file...what are the codes for that?

Regards,
Dan

mintblogger
02-12-2009, 02:26 PM
dandan, here is an excellent link, that provides a generic .htaccess file for a typical Wordpress blog. It includes Permalink 301 Redirection code too.

http://www.josiahcole.com/2007/07/11/almost-perfect-htaccess-file-for-wordpress-blogs/

Hope this helps.

dandan
02-12-2009, 02:49 PM
ok thanks for the information!

Regards,
Dan

Kevin
02-12-2009, 03:00 PM
You don't need to edit your htaccess file if you are running wordpres. Just make sure its writeable and wordpress will edit it for you (i.e. just set your preferred domain in the admin area).

knubbl
03-04-2009, 08:25 PM
All you really need to do is to go to your administration panel, click on settings and then on that page it should say something about your domain. Change it to http://www.domain.com/blog and you should be done ;)

__________________
Internet Marketing Tips (http://andbreak.com/)

bestblogs
04-14-2009, 02:06 AM
But I think he needs to consider type in traffic also, so editing your .htaccess is best (if WP can do it).

Don't know if adding code here works, but try in .htaccess:
#Force www domain
RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain\.com [nc]
RewriteRule (.*) http://www.yourdomain.com/$1 [R=301,L]
#End force www

sarahG
04-14-2009, 11:02 AM
You would be better to simply say 'if the domain is NOT www.yourdomain.com, redirect to www.yourdomain.com', that way any parked domains are also caught. Modified code is below:

#Force www domain
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com [nc]
RewriteRule (.*) http://www.yourdomain.com/$1 [R=301,L]
#End force www

mrtwister
05-17-2009, 10:28 PM
Thanks for the information.

I was looking for this information for quite a while.

I have started to love this forum.