| | #1 |
| Active Warrior Join Date: 2011 Location: NYC
Posts: 71
Thanks: 20
Thanked 4 Times in 2 Posts
|
Hi Guys, I'm taking an old website I have and 301 redirecting it to a brand new site. The problem is that it has about 20 pages ending in www.oldsite/public_html/oldpage.html and I want them all to go to my new website which doesnt have html extensions. www.NEWsite/NEWPAGE what is the code for redirecting .html to regular webpage? I tried this... Options +FollowSymLinks RewriteEngine on RewriteRule (.*) http://www.NEW WEBSITE.com/$1 [R=301,L] But it only works for the homepage! thanks |
| NOVA CUSTOM PRINTING- Graphic Design, Custom Printed Labels, Stickers, T Shirts & CD/DVD Manufacturing: NOVA CUSTOM LABEL PRINTING, NOVA CUSTOM T SHIRT PRINTING, NOVA DISC | |
| |
| | #2 |
| HyperActive Warrior Join Date: 2011
Posts: 106
Thanks: 3
Thanked 12 Times in 11 Posts
|
You will probably have to define each one individually if the file names have changed, something like this. Code: redirect 301 /current/currentfile.html http://www.newdomain.com/new/newfile |
| |
| | #3 | |
| HyperActive Warrior War Room Member Join Date: 2011 Location: Colorado
Posts: 176
Thanks: 6
Thanked 49 Times in 25 Posts
|
Yep... this would probably be easiest. You said you only have about 20 pages. Im certain there is a dynamic way to do it, but it would be faster just to make the 20 individual ones. | |
|
I am a php developer and Wordpress Guru. I was the original coder of Socrates and Metamorphosis. Be on the look out for my NEXT Theme... hopefully you will find it launched as a WSO in the next month or so. Optin for Special Pricing Need some help with Wordpress? find me on fiverr | ||
| |
| | #4 | |
| Active Warrior Join Date: 2011 Location: NYC
Posts: 71
Thanks: 20
Thanked 4 Times in 2 Posts
|
de Options +FollowSymLinks RewriteEngine on RewriteRule (.*) http://www. newsite/$1 [R=301,L] redirect 301 /current/currentfile.html http: // www.newdomain.com/new/newfile the home page works but the second one goes to www .NEW WEBSITE/public_html/oldpagename.html/ resulting in a 404 page (My new wordpress website then says "Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post." with a search box.) The old website pages were in the public html folder. Like www .OLD WEBSITE/public_html/oldpagename.html I want to send it to to new wordpress site at: www .NEW WEBSITE/newpagename Is that the problem? how can I fix that? thanks! | |
| NOVA CUSTOM PRINTING- Graphic Design, Custom Printed Labels, Stickers, T Shirts & CD/DVD Manufacturing: NOVA CUSTOM LABEL PRINTING, NOVA CUSTOM T SHIRT PRINTING, NOVA DISC | ||
| |
| | #5 |
| Active Warrior Join Date: 2011 Location: NYC
Posts: 71
Thanks: 20
Thanked 4 Times in 2 Posts
|
can anyone help me with this please? It's urgent because this website has been offline for 3 days! thank you |
| NOVA CUSTOM PRINTING- Graphic Design, Custom Printed Labels, Stickers, T Shirts & CD/DVD Manufacturing: NOVA CUSTOM LABEL PRINTING, NOVA CUSTOM T SHIRT PRINTING, NOVA DISC | |
| |
| | #6 |
| New Warrior Member Join Date: 2008
Posts: 8
Thanks: 0
Thanked 1 Time in 1 Post
|
If it's only 20 pages why don't you manually redirect them? the faster you do it the better for search engines. But if you want to do it with regexp maybe you can use redirectMatch, try something like this: RedirectMatch 301 /(.*)$ http...domain.com/$1 |
| | |
| |
| | #7 | |
| Active Warrior Join Date: 2011 Location: NYC
Posts: 71
Thanks: 20
Thanked 4 Times in 2 Posts
|
Thanks. I am not a programmer. Can you please tell me how to fit that into this code below? Which line do I replace? Options +FollowSymLinks RewriteEngine on RewriteRule (.*) http://www. newsite/$1 [R=301,L] redirect 301 /current/currentfile.html http: // www.newdomain.com/new/newfile thanks | |
| NOVA CUSTOM PRINTING- Graphic Design, Custom Printed Labels, Stickers, T Shirts & CD/DVD Manufacturing: NOVA CUSTOM LABEL PRINTING, NOVA CUSTOM T SHIRT PRINTING, NOVA DISC | ||
| |
| | #8 |
| HyperActive Warrior Join Date: 2011
Posts: 106
Thanks: 3
Thanked 12 Times in 11 Posts
|
Here's some code that should redirect all the pages for you. Code: RewriteEngine on RedirectMatch 301 (.*).html$ http://www.example.com/$1 |
| |
| | #9 | |
| Active Warrior Join Date: 2011 Location: NYC
Posts: 71
Thanks: 20
Thanked 4 Times in 2 Posts
|
the home page works but all others goes to www .NEW WEBSITE/public_html/oldpagename.html/ resulting in a 404 page I want to send them from the old html pages to brand new, renamed, non-html pages. can anyone correct this code? thanks | |
| NOVA CUSTOM PRINTING- Graphic Design, Custom Printed Labels, Stickers, T Shirts & CD/DVD Manufacturing: NOVA CUSTOM LABEL PRINTING, NOVA CUSTOM T SHIRT PRINTING, NOVA DISC | ||
| |
| | #10 |
| HyperActive Warrior Join Date: 2011
Posts: 106
Thanks: 3
Thanked 12 Times in 11 Posts
|
Oops, sorry I should have payed more attention when posting. I hate posting code here it always strips something out. Anyway, there should be a backslash before .html$, I put the code on pastebin Hopefully it works for you this time. |
| |
| | #11 | |
| Active Warrior Join Date: 2011 Location: NYC
Posts: 71
Thanks: 20
Thanked 4 Times in 2 Posts
|
Pasted exactly what you posted and it's still the same. what's going on? thanks | |
| NOVA CUSTOM PRINTING- Graphic Design, Custom Printed Labels, Stickers, T Shirts & CD/DVD Manufacturing: NOVA CUSTOM LABEL PRINTING, NOVA CUSTOM T SHIRT PRINTING, NOVA DISC | ||
| |
| | #12 |
| HyperActive Warrior Join Date: 2011
Posts: 106
Thanks: 3
Thanked 12 Times in 11 Posts
|
Did you clear your browsers cache?
|
| |
| | #13 |
| Warrior Member Join Date: 2012
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
|
a 301 Redirect is a permanent redirect which passes between 90-99% of link juice (ranking power) to the redirected page. 301 refers to the HTTP status code for this type of redirect. In most instances, the 301 redirect is the best method for implementing redirects on a website..
|
| | |
| |
|
| Bookmarks |
| Tags |
| 301, code, redirect, seo |
| |