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

Joined
Sep 24, 2013
Messages
187
Reaction score
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:
in the code part?

here it is agian :
Redirect 301 /p=7.html http://site.com/newpage/
 
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?

Open notepad and manually create a blank file named p=7.html then upload it into your root folder.
 
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.
 
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/

how is that code different from what i pasted above?
 
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.
 
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.
 
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.
 
Would this be the correct code:

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