Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

301 Redirect for Page Name Changes

I want to change a few of the page names in my site. Pretty sure I need to use a .htaccess file, which I know how to create and then upload to the root directory on my web host.


I'm also pretty sure of the code to use

Redirect 301 /previous-page.html http://www.xyz-site.com/new-page.html

What I can't seem to get right is the paths to use in the old and new field. It should be asy, but iWeb comes up with some pretty crazy URLs. As a test I changed one page name from Scanned to scanned.

This is the URL http://www.capecodupholstery.com/Photo-Gallery/Pages/scanned.html

I've tried several combinations with no luck.

Mac OS X (10.7.3), 12G Ram, AppleTV2, iPhone4, Airport

Posted on Feb 9, 2012 2:08 AM

Reply
Question marked as Best reply

Posted on Feb 9, 2012 4:14 AM

Here's how it works om my server :


http://home.wyodor.net/Photo-Gallery/Pages/Scanned.html


redirects to :


http://home.wyodor.net/Photo-Gallery/Pages/scanned.html


Here's how it works if the folders are empty :


http://home.wyodor.net/Photo-Gallery/

http://home.wyodor.net/Photo-Gallery/Pages/

17 replies

Feb 9, 2012 5:14 AM in response to Wyodor

Sorry for not replying sooner, I fell asleep!


From what I've read about a 310 redirect .htaccess file, the old page name is only the path beyond the root directory. The new page name contains the entire path. So would the .htaccess file look like this:


Redirect 301 /Photo-Gallery/Pages/Scanned.html http://www.capecodupholstery.com/Photo-Gallery/Pages/scanned.html

Feb 9, 2012 7:32 AM in response to Wyodor

I have 5 pages in my site I would like to change the names to. Ideally I would like to have one .htaccess file located in the root directory with all 5 redirects. I know it can be done, just can't figure out the correct paths.


The reason I'm doing this is because I started my iWeb site many many years ago before I knew about proper paths for a URL. I'm seeing a developing problem if I want to use a new App to rebuild my iWeb site and use the same page names. I have things like page names with capital letters and spaces between words. The apps I've worked with so far want to reformat capital letters to small cap and spaces to hyphens instead of underscores. So my thinking is to start by changing the page names before I have issues later on.

Feb 9, 2012 7:52 AM in response to Joe Gramm

Why not duplicate an index.html file and rename it to oldpagename.html.


Then open the file in a texteditor and change the name it should redirect to in the metatag.


The photo gallery page looks okay to me :


http://www.capecodupholstery.com/Photo-Gallery/Photo-Gallery.html


And there is no Scanned.html (Uppercase S) file to redirect :


http://www.capecodupholstery.com/Photo-Gallery/Pages/Scanned.html


And see if you can create a custom 404 (not found) page. Paste this code in a htaccess file :


ErrorDocument 404 /missing.html


The htaccess file should be in the root of the server.


http://www.google.com/search?q=cool+404+error+pages

Feb 9, 2012 8:04 AM in response to Wyodor

Wyodor wrote:

The photo gallery page looks okay to me :


http://www.capecodupholstery.com/Photo-Gallery/Photo-Gallery.html


And there is no Scanned.html (Uppercase S) file to redirect :

I deleted the .htaccess file from the pages folder, as I didn't want to leave the page broken. So you probably looked at it after I deleted it. And yes, there is no /Scanned.html because I changed the name to scanned. I thought the purpose of the 301 redirect was to let Google know that if they've indexed that page as "Scanned" to go directly to "scanned" instead. That way Google doesn't think the page is empty. Is that the way it works.


Should I re-upload the .htaccess file for you see what I mean.

Feb 9, 2012 8:08 AM in response to Joe Gramm

Another way to do it is to use the meta refresh tag in the head of an html doc.


The iWeb produced index.html file is an example of this...


<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title></title><metahttp-equiv="refresh"content="0;url= domain-name.com/Top-Page-Name.html"/></head><body></body></html>


In "normal" website construction, the landing page of a site is the one named "index". Because of the way in which iWeb publishes sites, the index.html is used as a redirect to the top page in the left column.


To create a redirect from "Scanned" to "scanned", you would create a file with the code shown above, name it "Scanned.html" and enter the URL...


http://www.capecodupholstery.com/Photo-Gallery/Pages/scanned.html


... in the code.


When uploaded to the server, this will overwrite the original "Scanned.html" file and redirect visitors to the new "scanned.html".

Feb 9, 2012 4:03 PM in response to Roddy

Roddy wrote:

When uploaded to the server, this will overwrite the original "Scanned.html" file and redirect visitors to the new "scanned.html".

Roddy, I think is where the problem is. I do not still have the original "Scanned.html" file. The original Scanned page was changed to scanned and published. So I only have the one "scanned.html" file on the server.

Feb 10, 2012 6:46 AM in response to Wyodor

Wyodor,

I did what you said and although it does work in the sense that you no longer reach a dead link, which is good, but doing it that way still leaves the URL saying "Scanned and not "scanned". A few of the pages I want to change the names to have been indexed by Google for at least 10 years with the same name. Partly why my site site pages consume a whole page of search results.


So the pages I'm most concerned about changing the names to are the ones that are currently indexed. That's why I thought a permanent redirect was the way to go to get Google indexing the new page names right away. That's how it worked when I changed Domain names a few years ago. I went from (joegramm.com) to (capecodupholstery.com) and left all the page names the same. I used a permanent redirect .htaccess file to redirect one domain to the other. It was amazing to see the new domain being re-indexed starting within a few days.

Feb 10, 2012 10:11 AM in response to Wyodor

Thanks, I went to the page about removing an entire page from Google search result, which I will do, but not until the newer page with the name change get's indexed.


I've actually had success in an unexpected way. On my web server (Host Excellence) Control Panel, there is a URL Redirect panel. In there at the Server level, I was easily ably to set up a Permanent URL Redirect. It is not the same as doing a 301 Redirect .htaccess file, but HE assures me(?) that google will find the redirect in the control panel. The results are the same though, as far as the URL. I don't have or want the scanned page indexed. So I changed a page name that I do have indexed at Google and used the Server redirect for that. I changed the name from Resume > resume. Now if you go to Resume, the URL has "resume". http://www.capecodupholstery.com/Resume.html (Don't Laugh) Just what I wanted. So now with the Page Redirect and new sitemap.xml, I should be good to go.

Feb 10, 2012 11:54 AM in response to Joe Gramm

For some reason the Resume link above is not working on my end. Does that link work for others. I can use that link in a bwoser, email and other places and it works. But for some reason the above link does not include the .html at the end when I click the link. Trying it here again, sorry. http://www.capecodupholstery.com/Resume.html


Going nuts !!

301 Redirect for Page Name Changes

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.