URL problem

Hi all,
I am doing some volunteer work for a non-profit. This is the problem, when you go to [noparse]www.kindnessranch.org[/noparse] you get one landing page and when you get rid of the “www” you get a totally different landing page. I copied this site’s files to my local host to work on it off line, also copying the database, setting it all up on MAMP. I ran the sql scripts to change the “home” and “site” to localhost:8888/kindnessranch, which is where it is located on my computer. When I work on the site I am on the kindnessranch.org landing page not the other one and the changes I do do not effect the [noparse]www.kindnessranch.org[/noparse] landing page. I need to be on the [noparse]www.kindnessranch.org[/noparse] landing page when I am working on it.

Any ideas?

Thanks in advance,

Not sure, but i think you need to add the following code in .htaccess file, this code makes all the url adresses to be with ‘www.’, and the address without ‘www.’ is redirected to url with ‘www’:
Try add this code in .htaccess:

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

Where do I find this file? Thanks, M.

You must create the “.htaccess” file in the root web site folder, with Notepad.
Just look on the net for “htacess file” and i’m sure you’ll fin the answer.


MarPlo has some good advice but there is one other thing to consider. The code that he has given for the redirect from non-www to www will make only one page the home page but this is not really a good solution for your particular issue. I’m not exactly sure why you are seeing two different pages for the non-www and www versions of your site but this should not be the case and redirecting one to the other is more of a band aid for the problem.

To make one home page, you should take the content that you want there and name the file index.html and load it to your root folder on your domain (typically something like web or hdocs or html).

You can implement the redirect so that you only have one version of the home page but this is a technique used for canonicalization (letting search engines know which URL to index) and not for curing your issue.
As far as creating the .htaccess file, not all web servers support .htaccess. Chances are if you have one in your root that your web host does.

Here is a tutorial on redirections,