Forum Moderators: phranque
My current site <snip> is opening from http://www.example.com
But from http://example.com its going to cpanel.
Want http://example.com also to open www.example.com
Current .htaccess is
RewriteCond %{HTTP_HOST} ^.example\.com$
RewriteRule ^(.*) http://www.example.com/$1 [L,R=301]
Above is not working also how long will it take for example.com to point to www.example.com after changes.
Please suggest if something completely new has to be done.
Regards
Rajiv
[edited by: engine at 11:41 am (utc) on July 7, 2009]
[edited by: jdMorgan at 4:16 pm (utc) on July 7, 2009]
[edit reason] Please use example.com [/edit]
I would also suggest changing the first line to:
RewriteCond %{HTTP_HOST} [b]![/b]^[b]www\[/b].example\.com$ [edited by: engine at 11:41 am (utc) on July 7, 2009]
[edit reason] examplified [/edit]
Do you have any other rewriterules already working? If not the code above will need to be prefaced with either the second of these lines or both of these lines:
Options +FollowSymLinks -MultiViews
RewriteEngine on
Options +FollowSymLinks -MultiViews
RewriteEngine on
#
RewriteRule ^foo\.html$ http://www.google.com/ [R=302,L]
Changes made to .htaccess should take effect immediately, as soon as the file is uploaded. On the other hand, changes to DNS will take time to propagate -- about 4 hours for modern/advanced DNS servers, but up to four days for older equipment. Therefore, changes will usually be seen very quickly in developed countries, but may take some time in developing countries.
Please note that we do not allow posting of individual members' domain names -- to protect us, to protect you, and to protect our members.
Jim
[edited by: jdMorgan at 12:45 pm (utc) on July 8, 2009]
You have totally confused me, I have the rewrite rules in both htaccess as well as httpd.conf
I guess i will have to do the dns for just example.com
where do i do this in WHM or under the domain registrar personal panel.
Rajiv
[edited by: jdMorgan at 1:51 pm (utc) on July 8, 2009]
[edit reason] example.com. Please see Terms of Service. [/edit]
Is there an "A record" or CNAME entry for both "example.com." and "www.example.com." (or "*.example.com.")?
You will need at least two entries, one for "server.example.com." and another for "example.com." And note that the trailing period is important.
Jim
[edited by: jdMorgan at 1:54 pm (utc) on July 8, 2009]