Forum Moderators: phranque
I tried doing this but it doesn't work. I just get a "page not found" error.
I can't seem to locate a tutorial on how to create this special file that redirects old pages which have new names.
This is a redirect line:
Redirect 301 /folder/oldfilename.html [domain.com...]
2. Also, can I list all the pages on one file? or does each page have to be a separate one?
3. How long does one leave these htaccess files on the server?
4. Does it have to be in the folder where the pages are? or are they supposed to be in the root folder?
5. If the pages are no longer on the server, (because I get a page not found error) then this would just work for someone who happened to bookmark the page, correct?
6. Supposedly this saves your ranking on a SE, which is the only reason I'm doing it for the client.
1. How do I save the file without an extension? so that it's NOT a txt file?Call it htaccess.txt in your computer and rename it to .htaccess once you've uploaded it to the server.
2. Also, can I list all the pages on one file? or does each page have to be a separate one?Yes, list all the pages on one file.
3. How long does one leave these htaccess files on the server?Hard to say.. I'm seeing requests for pages that are gone since 2000 or 2001..
4. Does it have to be in the folder where the pages are? or are they supposed to be in the root folder?In the root folder.
5. If the pages are no longer on the server, (because I get a page not found error) then this would just work for someone who happened to bookmark the page, correct?Yes. You can test if it works by typing in the old URLs in your browser. You should be redirected and the address bar of your browser should show the new URL
6. Supposedly this saves your ranking on a SE, which is the only reason I'm doing it for the client.Yes.
Sorry you had to talk to yourself for a while..
When I type in the old url it comes up "page not found." So I'm unable to see if it works because the old pages are no longer on the server.
list all the pages on one file
I list all the old pages and new pages on the ONE htaccess page? Someone had said I needed one htaccess page for every old/new page. So it is important I clarify this one also.
Thank you again.
And yes, list all your redirects on one .htaccess. You can only have multiple .htaccesses if you put them in different directories. No reason for that in your case.
Redirect 301 /folder/oldfilename.html http://www.example.com/folder/newfilename.html
Redirect 301 /folder/oldfilename2.html http://www.example.com/folder/newfilename2.html
If you're sure the file is up there and the redirects are in there like above and it still isn't working you have to contact the host of the site to enable the use of .htaccess.
Yes, I set up each line appropriately, like above.
I did read that supposedly the redirect 301 is used for certain servers - can I mention the name of it here? and the host server, in this case, is a different one. If I can mention those on this forum then I can explain further.
So I'm wondering if that is the reason it wouldn't work. But again, I wouldn't know because I've not ever bookmarked any of the old pages for them to be cached and come up and have the redirect work.
Those old pages are no longer on the server, so when I type in the old url to a specific old page, it's just "not found."