Announcement

Collapse
No announcement yet.

Duplicate page issue

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Duplicate page issue

    Hi, hope somebody can help.

    ive been advised on a site that the www. and the non www. should point to the same page.

    ie...thisdomainname.com should re-direct to www.thisdomainname.com

    How do i achieve this ?

    Also, the page www.thisdomainname.com and www.thisdomainname.com/index are the same page.

    What do i do about this ?

    (note: domains are made up and not linking to actual site)
    Reverse Osmosis Water Filters

    #2
    Look up .htaccess and google webmaster tools
    "If my answers frighten you then you should cease asking scary questions"

    Comment


      #3
      ok, this needs dumbing down a bit for me ?

      how can google webmaster tools help ?
      Reverse Osmosis Water Filters

      Comment


        #4
        You use Google Webmaster Tools when Google see's both www and non www. pages. (Google treats them as separate sites). You can then tell Google how you want it to treat them. See this link for more info - http://www.google.com/support/webmas...nswer=139066#1
        This method is used to help with search engine placements, but doesn't stop it from happening. That's where the .htaccess file comes in. Here's a link some Google results on the subject - http://www.google.co.uk/search?q=.ht...ww+and+non+www

        Hope this helps
        Paul
        "If my answers frighten you then you should cease asking scary questions"

        Comment


          #5
          A search of the forum should bring up several relating threads for directing non-www urls to www urls

          We add the following into our .htaccess file
          Options +FollowSymLinks
          RewriteEngine on
          RewriteCond %{HTTP_HOST} ^mysite.co.uk [NC]
          RewriteRule ^(.*)$ http://www.mysite.co.uk/$1 [L,R=301]
          There are several varations of this code but all basically do the same thing.



          In the 'Settings' tab of 'Site Configuration' in Google Webmaster Tools you can tell Google if you would prefer URLs in search results to be displayed with ot without the 'www'.

          The options are:
          Don't set a preferred domain
          Display URLs as www.mysite.co.uk
          Display URLs as mysite.co.uk
          Darren Guppy
          Golf Tee Warehouse
          Golf Tees and Golf Accessories.

          Comment


            #6
            ok, so i use the following in a .htaccess file.

            I used notepad to create a .htaccess file with the code in below (using my domain) but it wont let me save it to the public_html or the root...it just disappears ??

            Options +FollowSymLinks
            RewriteEngine on
            RewriteCond %{HTTP_HOST} ^yoursite.com
            RewriteRule (.*) http://www.yoursite.com/$1 [R=301,L]
            RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/
            RewriteRule ^index\.html$ http://www.yoursite.com/ [R=301,L]
            Reverse Osmosis Water Filters

            Comment


              #7
              Originally posted by mythandmagic View Post
              ok, so i use the following in a .htaccess file.

              I used notepad to create a .htaccess file with the code in below (using my domain) but it wont let me save it to the public_html or the root...it just disappears ??
              I've had this happen before. You will need to contact your hosting provider and ask them to display the .htacess files for you.
              "If my answers frighten you then you should cease asking scary questions"

              Comment


                #8
                Originally posted by mythandmagic View Post
                ok, so i use the following in a .htaccess file.

                I used notepad to create a .htaccess file with the code in below (using my domain) but it wont let me save it to the public_html or the root...it just disappears ??

                Options +FollowSymLinks
                RewriteEngine on
                RewriteCond %{HTTP_HOST} ^yoursite.com
                RewriteRule (.*) http://www.yoursite.com/$1 [R=301,L]
                RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/
                RewriteRule ^index\.html$ http://www.yoursite.com/ [R=301,L]
                Have you checked to see if it has uploaded to your site root and is just being hidden by your server? Try going to your site without using the www and see if the address gets rewritten in your browser - if it does then your .htaccess works and job done
                The Pretty Dress Company

                Comment


                  #9
                  yes, it was my ftp upload hiding it.

                  Can somebody tell me if that .htaccess is correct ?

                  so the non www goes to the www.

                  and also, if anyone uses the /index.html it redirects to the main domain.
                  Reverse Osmosis Water Filters

                  Comment


                    #10
                    Nope, it's not working

                    This is one of mine so you could use it as a template:
                    Options +FollowSymlinks
                    RewriteEngine on
                    rewritecond %{http_host} ^seaspraytraining.com [nc]
                    rewriterule ^(.*)$ http://www.seeaspraytraining.com/$1 [r=301,nc]
                    rewritecond %{http_host} ^seaspraytraining.co.uk [nc]
                    rewriterule ^(.*)$ http://www.seeaspraytraining.com/$1 [r=301,nc]
                    rewritecond %{http_host} www.seeaspraytraining.co.uk [nc]
                    rewriterule ^(.*)$ http://www.seeaspraytraining.com/$1 [r=301,nc]

                    It doesn't address your index.html issue but it should get you started
                    Last edited by meden; 30-Apr-2011, 12:36 PM. Reason: edited the url as it was causing a dead link in Google tools
                    The Pretty Dress Company

                    Comment


                      #11
                      tell us what is in your htaccess file... and where you put it.

                      Comment


                        #12
                        The .htaccess he's used is quoted in my post Jo (I suspect the 'L' after the '301' may be the source of the problem- that or the file is in the acatalog directory of course)
                        The Pretty Dress Company

                        Comment


                          #13
                          Do you not need to escape the period in the rewrite condition for .com , .co.uk, etc?

                          i.e.

                          rewritecond %{http_host} ^seaspraytraining\.com [nc]

                          Mike

                          Edit: OK. Answered myself. The period matches any single character so it will work without the escape.
                          -----------------------------------------

                          First Tackle - Fly Fishing and Game Angling

                          -----------------------------------------

                          Comment


                            #14
                            No, I don't think so - I'm not a regex expert but this seems to work on the site anyway
                            The Pretty Dress Company

                            Comment

                            Working...
                            X