Any danger in this?

Discussion in 'HTML & Website Design' started by swollenpickles, Nov 14, 2006.

  1. #1
    swollenpickles, Nov 14, 2006 IP
  2. mrconfident

    mrconfident Guest

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I guess I would be curious to know why you'd be worry about that? I don't know the answer to this, but I'm curious as well. :)
     
    mrconfident, Nov 14, 2006 IP
  3. Richie_Ni

    Richie_Ni Illustrious Member

    Messages:
    10,721
    Likes Received:
    1,175
    Best Answers:
    0
    Trophy Points:
    410
    #3
    Danger?
    Why you though it's dangerous?
     
    Richie_Ni, Nov 14, 2006 IP
  4. swollenpickles

    swollenpickles Active Member

    Messages:
    1,271
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    80
    #4
    Well maybe not life and death dangerous but I suppose I'm more so concerned that search engines might view it as 2 sites and therefore may affect PR or something in some way?
     
    swollenpickles, Nov 14, 2006 IP
  5. smallbuzz

    smallbuzz Peon

    Messages:
    125
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    google will think its 2 sites. If you use google sitemap, you can tell google to always use the www. one.
     
    smallbuzz, Nov 14, 2006 IP
  6. swollenpickles

    swollenpickles Active Member

    Messages:
    1,271
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    80
    #6
    Is there a way I can get it forwarding or make browsers just use the one?
     
    swollenpickles, Nov 14, 2006 IP
  7. SoKickIt

    SoKickIt Active Member

    Messages:
    305
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    70
    #7
    301 redirect
     
    SoKickIt, Nov 14, 2006 IP
    swollenpickles likes this.
  8. swollenpickles

    swollenpickles Active Member

    Messages:
    1,271
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    80
    #8
    Thanks for that link. So basically I need to place the following code in the .htacess file of the root directory:
    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{http_host} ^domain.com [nc]
    rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc] 
    Code (markup):
    Can I simply cut and paste this code into the existing .htaccess file? If so does it matter where I paste it?
    Thanks
     
    swollenpickles, Nov 16, 2006 IP
  9. SoKickIt

    SoKickIt Active Member

    Messages:
    305
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    70
    #9
    Just paste it. If it doesn't work, post your .htaccess file here and we'll see what's wrong ;)
     
    SoKickIt, Nov 16, 2006 IP
  10. swollenpickles

    swollenpickles Active Member

    Messages:
    1,271
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    80
    #10
    Cool, I'll give it a crack tonight.
    Cheers
     
    swollenpickles, Nov 16, 2006 IP
  11. Sem-Advance

    Sem-Advance Notable Member

    Messages:
    6,179
    Likes Received:
    296
    Best Answers:
    0
    Trophy Points:
    230
    #11
    Actually you do not use a 301 to fix this:confused: 301 fixes broken links on the web

    You need to do a Canonical URL rewrite

    The goal of this rule is to force the use of a particular hostname, in preference to other hostnames which may be used to reach the same site. For example, if you wish to force the use of www.example.com instead of example.com, you might use a variant of the following recipe.
    Solution:

    RewriteCond %{HTTP_HOST} !^fully\.qualified\.domain\.name [NC]
    RewriteCond %{HTTP_HOST} !^$
    RewriteRule ^/(.*) http://fully.qualified.domain.name/$1 [L,R]


    This should solve your problem and solidify your PR

    301 wtf?
     
    Sem-Advance, Nov 16, 2006 IP
  12. SoKickIt

    SoKickIt Active Member

    Messages:
    305
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    70
    #12
    Google is using 301 redirect for the same thing. wtf?
     
    SoKickIt, Nov 16, 2006 IP
  13. Sem-Advance

    Sem-Advance Notable Member

    Messages:
    6,179
    Likes Received:
    296
    Best Answers:
    0
    Trophy Points:
    230
    #13
    Really......where is the proof?
     
    Sem-Advance, Nov 16, 2006 IP
  14. SoKickIt

    SoKickIt Active Member

    Messages:
    305
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    70
    #14
    Run this script and you'll see.

    
    <?php
    
    	$fp = fopen("http://google.de", 'r');
    	$meta_data = stream_get_meta_data($fp);
    	fclose($fp);
    	
    	print_r($meta_data);
    	
    ?>
    
    PHP:
     
    SoKickIt, Nov 16, 2006 IP
  15. swollenpickles

    swollenpickles Active Member

    Messages:
    1,271
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    80
    #15
    Confused now guys, what am I sposed to do?
     
    swollenpickles, Nov 16, 2006 IP
  16. Sem-Advance

    Sem-Advance Notable Member

    Messages:
    6,179
    Likes Received:
    296
    Best Answers:
    0
    Trophy Points:
    230
    #16
    Pickels

    The 301 code others gave you is if you changed page names and people linked to the old page name it will forward them to the new page name.


    The canocical URL rewrite takes any links (broken / links others place) to your site and resolves them to the correct URL and at the same time solidifys your Google PR.
     
    Sem-Advance, Nov 16, 2006 IP
  17. Sem-Advance

    Sem-Advance Notable Member

    Messages:
    6,179
    Likes Received:
    296
    Best Answers:
    0
    Trophy Points:
    230
    #17

    I dont run scripts from people I dont know.....either you have proof or you dont.
     
    Sem-Advance, Nov 16, 2006 IP
  18. bobby9101

    bobby9101 Peon

    Messages:
    3,292
    Likes Received:
    134
    Best Answers:
    0
    Trophy Points:
    0
    #18
    use:
    
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^[COLOR="Red"]domain.com[/COLOR] [NC] 
    RewriteRule ^(.*)$ http://www.[COLOR="Red"]domain.com[/COLOR]/$1 [L,R=301]
    
    Code (markup):
    replace the red parts with your domain name
     
    bobby9101, Nov 16, 2006 IP
  19. bobby9101

    bobby9101 Peon

    Messages:
    3,292
    Likes Received:
    134
    Best Answers:
    0
    Trophy Points:
    0
    #19
    @ sem-advice, that is a safe script.
     
    bobby9101, Nov 16, 2006 IP
  20. Sem-Advance

    Sem-Advance Notable Member

    Messages:
    6,179
    Likes Received:
    296
    Best Answers:
    0
    Trophy Points:
    230
    #20
    It may or may not be I dont trust many people here....

    Also you posted the same 301 code which doesnt solve the problem correctly...

    Just read my post it should make perfect sense.

    If not I will be glad to meet anyone on IM or phone tomorrow
     
    Sem-Advance, Nov 16, 2006 IP