301 Redirect is drive me crazy

Discussion in 'Search Engine Optimization' started by Assured99, Jan 31, 2006.

  1. #1
    So i set up a 301 for page www.assuredmedical.com/privacypolicy.htm to go to www.assuredmedical.com/privacypolicy.html but no this could not be that easy for me any ideas what im doing wrong here ?
     
    Assured99, Jan 31, 2006 IP
  2. mariense

    mariense Well-Known Member

    Messages:
    104
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    108
    #2
    I think this will work:

    RewriteRule ^privacypolicy\.htm$ /privacypolicy.html [R,L]
     
    mariense, Jan 31, 2006 IP
  3. Jean-Luc

    Jean-Luc Peon

    Messages:
    601
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi,

    I had a look at your page. What did you do so far ?

    The rewrite rule that mariense gave should be written in a .htaccess file. This has nothing to do with VBScript.

    Jean-Luc
     
    Jean-Luc, Jan 31, 2006 IP
  4. Assured99

    Assured99 Peon

    Messages:
    78
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I have no idea where the origional privacypolicy.htm is so i created a new one with a redirect script in it and that is where it got me

    <%@ Language=VBScript %>
    <%
    Response.Status="301 Moved Permanently" Response.AddHeader "Location", " http://www.assuredmedical.com/privacypolicy.html"
    >
    that is the code i used
     
    Assured99, Jan 31, 2006 IP
  5. Jean-Luc

    Jean-Luc Peon

    Messages:
    601
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You try to use an ASP program in a file which is just displayed because its name ends in .htm. This is not going to work.

    Maybe you can try what I suggested with the .htaccess file.

    Jean-Luc
     
    Jean-Luc, Jan 31, 2006 IP
  6. Assured99

    Assured99 Peon

    Messages:
    78
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #6
    ok so i put that into a ascci file with the extension .htaccess and put that into which Dir for my page the root dir or the .htaccess dir?
     
    Assured99, Jan 31, 2006 IP
  7. Jean-Luc

    Jean-Luc Peon

    Messages:
    601
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Yes and no. What I would do :
    - create an ascii file that you name .htaccess.txt
    - upload it to the same directory as your page privacypolicy.htm
    - rename the uploaded file .htaccess
    - try to view your page in your browser.

    The .txt extension first makes sure the file is uploaded as an ascii file, but you need to remove this .txt extension to use the file. It could be that the file "disappears" from your FTP software when you rename is (don't worry about that).

    Jean-Luc
     
    Jean-Luc, Jan 31, 2006 IP
  8. Assured99

    Assured99 Peon

    Messages:
    78
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #8
    see theres the snag i have no idea where the origional .htm is i just created a blank one
     
    Assured99, Jan 31, 2006 IP
  9. Jean-Luc

    Jean-Luc Peon

    Messages:
    601
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #9
    The content of the .htaccess file can vary depending on your system. I would use this :
    Options +FollowSymlinks
    RewriteEngine on 
    RewriteRule ^privacypolicy\.htm$ /privacypolicy.html [R=301,L]
    Code (markup):
    Jean-Luc
     
    Jean-Luc, Jan 31, 2006 IP
  10. Jean-Luc

    Jean-Luc Peon

    Messages:
    601
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #10
    I meaned "same dir as privacypolicy.html".

    Jean-Luc
     
    Jean-Luc, Jan 31, 2006 IP
  11. Assured99

    Assured99 Peon

    Messages:
    78
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #11
    well lookie there it worked just did it thank you very much i appreciate it big time
     
    Assured99, Jan 31, 2006 IP
  12. Assured99

    Assured99 Peon

    Messages:
    78
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #12
    will this same method work if i do it for assuredmedical.com to (dub ya dub ya dub ya).assuredmedical(dot com) as well as for http:// (dub ya dub ya dub ya dot)assuredmedical(dot com) so they dont look like duplicates?
     
    Assured99, Jan 31, 2006 IP
  13. Jean-Luc

    Jean-Luc Peon

    Messages:
    601
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Good to see it worked fine.:)

    To avoid any duplicate content between your site with w w w and without w w w, change the .htaccess :
    Options +FollowSymlinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} !^www.assuredmedical.com$
    RewriteRule ^(.*)   http://www.assuredmedical.com/$1  [QSA,L,R=301]
    RewriteRule ^privacypolicy\.htm$ /privacypolicy.html [R=301,L]
    Code (markup):
    Jean-Luc
     
    Jean-Luc, Feb 1, 2006 IP
  14. Assured99

    Assured99 Peon

    Messages:
    78
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #14
    Awsome Thanks alot if theres anything i can do for ya let me know
     
    Assured99, Feb 1, 2006 IP
  15. gordonfreeman

    gordonfreeman Peon

    Messages:
    169
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #15
    you can also check my response on your other thread in Website Reviews
     
    gordonfreeman, Feb 1, 2006 IP
  16. execute

    execute Peon

    Messages:
    301
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #16
    Yeah good posts Jean. But I was wondering, is that possible if you have 2 different domains, and put an htaccess file in your new domain, checking for http:// yourolddoman to switch to http:// yournewdomain?
     
    execute, Feb 2, 2006 IP
  17. gordonfreeman

    gordonfreeman Peon

    Messages:
    169
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #17
    Write this into an .htaccess file on the old domain

    RewriteCond %{HTTP_HOST} ^olddomain\.com [NC]
    RewriteRule ^(.*)$ http://newdomain.com/$1 [L,R=301]
     
    gordonfreeman, Feb 3, 2006 IP
  18. Jean-Luc

    Jean-Luc Peon

    Messages:
    601
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #18
    You cannot do that in the new domain. You should do it in the .htaccess file of the old domain, like this :
    RedirectPermanent / http://www.yournewdomain.com/
    Code (markup):
    Jean-Luc
     
    Jean-Luc, Feb 3, 2006 IP