0

Hi,

I want to redirect domain.com to www.domain.com.I found may people mentioned about Rewrite Rule as shown below in .htaccess. I could not find .htaccess file in my apache. There is httpd.config file. How to force domain to display www.domain.com?

Options +FollowSymLinks

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


Thank You.

Would greatly appreciate your help/suggestion.

3
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by pritaeas
0

You could write your own .htaccess file and ftp it to your site.

You just need a text editor. However, in order to ensure that it works properly, save the file as, say htaccess.txt, then via FTP client upload it and rename it to .htaccess on the server itself.

0

Thank you for your quick reply. In my case, I have direct access to the server and no need FTP client upload. Where should I put the .htaccess file? I tried saving this file inside the root directory, but it didn't work.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.