MyBB Community Forums

Full Version: Adding www.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello

How to add www. tp th brginning of my site?

Thank you
Edit your board URL in your settings and add the www in front.
But when I add the www. the url don't work see www.premium4you.org
1>
Add this to your .htaccess
Quote:RewriteEngine on
RewriteCond %{HTTP_HOST} ^premium4you\.org$ [NC]
RewriteRule ^(.*)$ http://www.premium4you.org/$1 [R=301,L]



2>
(2011-11-21, 12:22 AM)Paul H. Wrote: [ -> ]Edit your board URL in your settings and add the www in front.

This don't work for me
You need to create a shortcut before the public_html folder area, and make this shortcut link back toward public_html. Your hosting account that you have must not have created this automatically for you, but it's a simple easy thing to fix.
redirect non www to www htaccess, Possible code to use ..


1.
 rewritecond %{http_host} ^phwebmaster.net [nc]
    rewriterule ^(.*)$ http://www.phwebmaster.net/$1 [r=301,nc]

2.
 RewriteCond %{HTTP_HOST} !^www\.phwebmaster\.net$
    RewriteRule (.*) http://www.phwebmaster.net/$1 [R=301,L]

3.
RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

4.
RewriteCond %{HTTP_HOST} ^phwebmaster.net [NC]
    RewriteRule ^(.*)$ http://www.phwebmaster.net/$1 [L,R=301]


All of this 4 codes should work on server that has mod rewrite enabled.
where to find htaccess file?
*public_html/.htaccess
*public_html/yourdomain.com/.htaccess
*htdocs/.htaccess