Make domain.com point to www.domain.com
| ||||
| | Thread Tools | Display Modes |
| #1 | ||||
| ||||
| Open or create a .htaccess file in the /public_html/ directory (if the domain is an add-on domain, then the .htaccess file will be located in add-on domain's directory) Put this at the top of the .htaccess file (replacing 'domain' with yours) Code: Options +FollowSymlinks RewriteEngine on rewritecond %{HTTP_HOST} ^domain.com [nc] rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]__________________ Sign Up Now! Unlimited Storage, Unlimited Transfer, Host Unlimited domain names, 1 Free Domain Name BlueHost Features | BlueHost Help Desk | Become a BlueHost Affiliate | BlueHost CEO Blog (888) 401-4678 | Create a support ticket Last edited by areidmtm; 01-16-2008 at 03:05 PM. |
| #2 | ||||
| ||||
| And of course the opposite.. Code: RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [nc] RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L] |
| #3 | |||
| |||
| For me it doesnt work. I get a page that says that "This site was moved to this location" and the word "this" is a link to "domain.com" and get an infinite loop. [EDIT] Forget. It was a conflict between the wordpress config and .htaccess settings. Changed it in Wordpress Admin Panel and everything is ok. Last edited by Diogenes; 01-30-2008 at 04:10 PM. |
| #4 | |||
| |||
| Another newbie here. I've tried to insert your text into a new .htaccess but changing the suffix from ".com" to ".co.uk" however it seems to be redirecting to the ".com". Options +FollowSymlinks RewriteEngine on rewritecond %{HTTP_HOST} ^mydomain.co.uk [nc] rewriterule ^(.*)$ http://www.mydomain.co.uk/$1 [r=301,nc] Is there something else I've missed? |
| #5 | ||||
| ||||
| Only if something else is redirecting it. |
| #6 | |||
| |||
| Not working for me, site is not opening check www.smsdad.com or check without www site is not opening.("Add-on domain" .htaccess file created in add-on domain directory) |
| #7 | ||||
| ||||
| What's in your htaccess file.. |
| #8 | |||
| |||
| Quote:
rewritecond %{HTTP_HOST} ^example\.org [nc] rewriterule ^(.*)$ http://www.example.org/$1 [r=301,nc] Try this for your site rewritecond %{HTTP_HOST} ^mydomain\.co\.uk [nc] The Apache writeup http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html |
| #9 | |||
| |||
| this is Code: Options +FollowSymlinks RewriteEngine on rewritecond %{HTTP_HOST} ^smsdad.com [nc] rewriterule ^(.*)$ http://www.smsdad.com/$1 [r=301,nc] |
| #10 | |||
| |||
| Quote:
|


0 comments:
Post a Comment