Forum Moderators: phranque

Message Too Old, No Replies

.htaccess.2343242?

2 .htaccess files

         

RunnerD

7:48 pm on Nov 10, 2005 (gmt 0)

10+ Year Member



I am trying to use this code to redirect non www pages:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain\.com [NC]
RewriteRule ^(.*)$ [domain.com...] [R=301,L]

I have put it in my .htaccess file and it does not seem to be working. I have 2 htaccess files. One is just .htaccess and the other one is .htaccess and a long number after it? Why is there 2?

Another question I have is there is 2 directories which contain the same files - www and public_html

I have deleted some of the www directories in a few of my websites. Is this okay? The sites still appear to be working correctly.

jdMorgan

8:20 pm on Nov 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your code is correct.

You should contact your host with these questions. Also ask about whether you are allowed to run mod_rewrite in your .htaccess file, and why there appears to be a backup .htaccess file (my guess) with a number on it.

It is not standard and not required that you have two copies of your files on a Web server, and I can't tell you how or why this happened. But it should not be necessary. Ask your host where your files should be located, make backups, and then delete the copy in the non-standard location.

It is possible that one set of files is supposed to be for www.example.com, and the other is supposed to be for example.com (no www). Again, make backups, and delete or rename the 'extra' ones and test. If this is the case, then you can put the redirect code into .htaccess file in the non-www filespace, and that will probably take care of the problem.

All servers are different. Some more than others, but all different.

Jim