.htaccess file - 301 redirect

What's Hot
FretwiredFretwired Frets: 24601
Say I have a domain https:\\www.mydomain.com how do I write a 301 redirect in the .htaccess file to https:\\mydomain.com

I haven't done this for years .....

Remember, it's easier to criticise than create!
0reaction image LOL 0reaction image Wow! 0reaction image Wisdom

Comments

  • TimmyOTimmyO Frets: 7542
    the command contains the word 'rewrite' if that helps googling

    hang on a sec...
    Red ones are better. 
    0reaction image LOL 0reaction image Wow! 0reaction image Wisdom
  • TimmyOTimmyO Frets: 7542
    it doesn't matter which one you use (www or naked) just pick the one that you prefer stylistically (or lazily - all those 'www' being typed.... :-) ) and use it consistently - helps SEO a smidge 
    Red ones are better. 
    0reaction image LOL 0reaction image Wow! 0reaction image Wisdom
  • BigMonkaBigMonka Frets: 1783
    TimmyO said:
    it doesn't matter which one you use (www or naked) just pick the one that you prefer stylistically (or lazily - all those 'www' being typed.... :-) ) and use it consistently - helps SEO a smidge 
    I didn't think that 301s were very good for SEO at all, has that changed?
    Always be yourself! Unless you can be Batman, in which case always be Batman.
    My boss told me "dress for the job you want, not the job you have"... now I'm sat in a disciplinary meeting dressed as Batman.
    0reaction image LOL 0reaction image Wow! 0reaction image Wisdom
  • TimmyOTimmyO Frets: 7542
    301 should be absolutely fine - it's a *permanent* redirect so google is able to teat it as such.

    People extracting money from clients for SEO will debate these things until the cows come home, but at the end of the day if there are links and references to both www. and naked domain your SEO is affected a bit. A 301 should make that effect very small indeed, and a LOT smaller than most other things.  
    Red ones are better. 
    0reaction image LOL 0reaction image Wow! 0reaction image Wisdom
  • TimmyOTimmyO Frets: 7542
    edited June 2017
    this is a decent summary:

    [quote] While it’s super awesome that Google is no longer “penalizing” 301 redirects through loss of PageRank, keep in mind that PageRank is only one signal out of hundreds that Google uses to rank pages.

    Ideally, if you 301 redirect a page to an exact copy of that page, and the only thing that changes is the URL, then in theory you may expect no traffic loss with these new guidelines.

    That said, the more moving parts you introduce, the more things start to get hairy. Don’t expect your redirects to non-relevant pages to carry much, if any, weight. Redirecting your popular Taylor Swift fan page to your affiliate marketing page selling protein powder is likely dead in the water. [/quote]


    from https://moz.com/blog/301-redirection-rules-for-seo


    Red ones are better. 
    0reaction image LOL 1reaction image Wow! 0reaction image Wisdom
  • BigMonkaBigMonka Frets: 1783
    Thanks @TimmyO that's good info 

    :-bd
    Always be yourself! Unless you can be Batman, in which case always be Batman.
    My boss told me "dress for the job you want, not the job you have"... now I'm sat in a disciplinary meeting dressed as Batman.
    0reaction image LOL 0reaction image Wow! 0reaction image Wisdom
  • FretwiredFretwired Frets: 24601
    TimmyO said:
    this is a decent summary:

    [quote] While it’s super awesome that Google is no longer “penalizing” 301 redirects through loss of PageRank, keep in mind that PageRank is only one signal out of hundreds that Google uses to rank pages.

    Ideally, if you 301 redirect a page to an exact copy of that page, and the only thing that changes is the URL, then in theory you may expect no traffic loss with these new guidelines.

    That said, the more moving parts you introduce, the more things start to get hairy. Don’t expect your redirects to non-relevant pages to carry much, if any, weight. Redirecting your popular Taylor Swift fan page to your affiliate marketing page selling protein powder is likely dead in the water. [/quote]


    from https://moz.com/blog/301-redirection-rules-for-seo


    Thanks for that .. figured it out in the end .. :-)

    Remember, it's easier to criticise than create!
    0reaction image LOL 0reaction image Wow! 0reaction image Wisdom
  • SRichSRich Frets: 763
    And in other news....... ;)

    I have no idea what you lot are talkin' about but I'll nod sagely.

    "There's things I want, there's things I think I want 
    There's things I've had, there's things I wanna have" 
    0reaction image LOL 0reaction image Wow! 0reaction image Wisdom
Sign In or Register to comment.