1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

why isnt this 301 redirect code working....?

Discussion in 'Black Hat SEO' started by Borgo Snonshick, May 3, 2014.

  1. Borgo Snonshick

    Borgo Snonshick BANNED BANNED

    Joined:
    Sep 24, 2013
    Messages:
    187
    Likes Received:
    23
    I have checked tutorials and changed the .htaccess file but it wont work.

    The code Im doing is:

    Code:
    Redirect 301 /p=7.html [URL]http://site.com/newpage/[/URL]
    When i put this into htaccess i just get 404'd on the front page.

    The original p=7 page doesnt exist cos i had to move to new hosting and wasnt able to get that page structure back (yes i know ill use post name in future from the begining!)

    I need the p=7 linkjuice tho as i have 4 months of juice in that cocksucker. I was at positon 2 with that url now my rnaks are destroyed and starting from scratch. I dont know why this cunt wont work?
     
    Last edited: May 3, 2014
  2. bk071

    bk071 Jr. Executive VIP Jr. VIP Premium Member

    Joined:
    Nov 24, 2010
    Messages:
    3,105
    Likes Received:
    7,917
    Occupation:
    I don't have a job
    Location:
    .............
    Where's the code?
     
    • Thanks Thanks x 1
  3. Borgo Snonshick

    Borgo Snonshick BANNED BANNED

    Joined:
    Sep 24, 2013
    Messages:
    187
    Likes Received:
    23
    in the code part?

    here it is agian :
    Redirect 301 /p=7.html http://site.com/newpage/
     
  4. Duffers5000

    Duffers5000 Elite Member

    Joined:
    Apr 1, 2012
    Messages:
    2,466
    Likes Received:
    7,615
    I know why its not working.
     
  5. JonnyBorneo

    JonnyBorneo Regular Member

    Joined:
    Feb 7, 2012
    Messages:
    388
    Likes Received:
    95
    Occupation:
    Affiliate
    Open notepad and manually create a blank file named p=7.html then upload it into your root folder.
     
  6. Borgo Snonshick

    Borgo Snonshick BANNED BANNED

    Joined:
    Sep 24, 2013
    Messages:
    187
    Likes Received:
    23
    didnt work.

    the actual url was actually /?p=7/ but im not allowed to save a '?' in filename :(
     
  7. JonnyBorneo

    JonnyBorneo Regular Member

    Joined:
    Feb 7, 2012
    Messages:
    388
    Likes Received:
    95
    Occupation:
    Affiliate
    Ok, how about making /?p=7/ folder manually in your FTP and then creating a blank index.html file inside it?
     
    • Thanks Thanks x 1
  8. ikstob

    ikstob Junior Member

    Joined:
    Nov 12, 2012
    Messages:
    147
    Likes Received:
    129
    Location:
    ikstob.com
    Home Page:
    Have you tried using the exact URL in the .htaccess file? e.g.

    Code:
    Redirect 301 /?p=7 http://site.com/newpage/
    Redirect 301 /?p=7/ http://site.com/newpage/
    I've just tested this in Apache 2.2.15 and it works for me.
     
    • Thanks Thanks x 1
  9. Borgo Snonshick

    Borgo Snonshick BANNED BANNED

    Joined:
    Sep 24, 2013
    Messages:
    187
    Likes Received:
    23
    how is that code different from what i pasted above?
     
  10. Borgo Snonshick

    Borgo Snonshick BANNED BANNED

    Joined:
    Sep 24, 2013
    Messages:
    187
    Likes Received:
    23
    I don;t seem to be able to redirect ANY urls through the htaccess.

    I tried doing it with the folders suggested above, but then i tried going back to sim ply redirect a page i definitely know exists and it wont even do that ????????????

    This is a fresh wp install so nothing strange in the code or anyhting which could have changed.
     
  11. roadhamster

    roadhamster Regular Member

    Joined:
    Mar 12, 2012
    Messages:
    300
    Likes Received:
    226
    I assume you still have control over the old server? Then you could use this:
    Code:
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} !^OLDDOMAIN\.com$ [NC]
    RewriteRule ^(.*)$ [URL]http://NEWDOMAIN.com[/URL] [R=301,L]
    
    It rewrites all the requests to the old domain to the new domain.
    Good luck.
     
    • Thanks Thanks x 1
  12. Borgo Snonshick

    Borgo Snonshick BANNED BANNED

    Joined:
    Sep 24, 2013
    Messages:
    187
    Likes Received:
    23
    Can someone explain this to me a bit more:

    http://www.localwisdom.com/blog/2014/02/htaccess-301-redirects-dont-work-wordpress/

    I get that you have to use rewrite code instead of the standard 301 code but they dont explain how to change the syntax for your own url to the rewrite code, they only show their example but no epxlanation how to change your own code into that format.

    hmm looking agian i might not have to change that code of theirs except put my domains in like usual. lets see..

    So could someone explain that to me plz.
     
  13. Borgo Snonshick

    Borgo Snonshick BANNED BANNED

    Joined:
    Sep 24, 2013
    Messages:
    187
    Likes Received:
    23
    Would this be the correct code:

    Code:
    RewriteEngine On
    RewriteRule ^/?p=7/(.*)$ /newurl/$1 [R=301,NC,L]
     
  14. Borgo Snonshick

    Borgo Snonshick BANNED BANNED

    Joined:
    Sep 24, 2013
    Messages:
    187
    Likes Received:
    23
    FINALLY fixed the cunt using a different wordpres plugin. :) :) :)