I’d like to add a 404 page to a website. The web site already exists and is functional with index.html and then the files that RW generates, such as:
These files already exist in the directory; so if I publish them I get queries as to whether I want to overwrite files. I don’t, because to do so would break the underlying site.
So how do I upload a single page?
Obviously you can’t link to a 404 page–a 404 page is a destination you’re directed to when links don’t work or when a page doesn’t exist.
There are several ways to create 404 pages; most involve editing .htaccess files. Another way–supposedly–is to create a single 404.shtml file.
The page looks great in preview (and as published locally) using RW and Stacks. But I don’t know how I can publish it effectively.
How can I do so without breaking the underlying page?
The first one doesn’t help at all. Is the author suggesting, when he says, “Create 2 new pages in your RW project” that you create a 404 project with two pages or add two 404 pages to an existing project? With respect to the former, you have precisely the problem I cited–two different sets of common files that will overwrite each other. If the second, you can’t add it to an existing project because of different themes, for one. This also suggests that you put the .shtml file under the server’s root, and not under html. So the first tutorial is useless and does not answer the question. The second example also fails to answer the question. There the venerable Will Woodgate suggests, “If you want to customise the error message shown, login to your web hosts (sic) CPanel and use the Error Pages option.” That’s great if your webhost has such a panel/service. Mine does not. So how do you get around the problem of overwriting common files as I asked in the question?
Here’s what MT says:
Me: The problem is that the html file is already populated with Rapidweaver common files; the 404 file doesn’t have access to these and they cannot be renamed for the 404 file.
I’m sorry Michael, but that is an issue with your site not your server. In order to serve the files you need to put them on the server in a way that they can be read by web browsers accessing your site.
Is there a way to rename the auxiliary files that RW creates and associates with the 404 page say, “sitemap2.xml” and “rw_common2” instead of sitemap.xml and “rw_common” to distinguish them from the published themes and common files used in the site as a whole?
To create this site, you’ve used stacks and themes that make you happy. But you want something else for a 404 page. So you go back to Rapidweaver and creae a new project. Call if 404.html.
If you publish locally, you will see:
404.html (because that’s the name you gave it)
If you try to publish this wonderful 404 page, you will have conflicts between the existing files and folders and the new files and folders, except for the file “404.html” because this does not exist under /domain.
All the other ones do.
The first tutorial suggests, though ambiguously, to add a custom 404 page to each site, i.e., to each index.html file or project. My experience (admittedly, limited) suggests that it is difficult to use a completely different theme for such a page when an existing theme is being used (putting asing Bootstrap, Foundation and Blank themes). So making a separate RW project for a 404 page makes sense–except that you can’t rename the automatically generated files. You can do so manually, but then the links are broken. You can’t rename them from within RW, as far as I can tell.
So the custom 404 page exists happily on the local machine but can’t be uploaded without wreaking havoc.
Not sure what you’re trying to do. There’s no such thing as an RW project without a theme. You can select a different theme, and you can have different themes for each page(page inspector).
So add the page to the existing project, change the theme to what you want and publish it.
I’m not sure why you’re trying to do your error page (404) in a different project. From a user experience, you’d want to have all the navigation links to get back to a proper working page. After all, they got there by mistake so you’d want to make it easy as you can to get to a valid page.
From a users experience, I’m not sure why you want a different theme for an error page, but you can.
Open locally published RW-created page in a text editor.
Rename all instances of /rw_common to /rw_common2
Rename all instances of /files to /files2
Rename all instances of /resources to /resources2
Rename the corresponding files and folders.
Now these can be uploaded with no conflict to each of the domains.
A sitemap.xml file isn’t essential, and I don’t know what would be the effect of having a file called “sitemap.xml” and “sitemap2.xml” under each domain, so the new “sitemap.xml” created by RW for the 404 file won’t get uploaded.
We’ll see if the *.shtml solution (in lieu of an .htaccess solution) works on this server.
Not sure why you’re going through all that. Your newly created project that only contains the 404 page won’t have any navigation back to the real site.
Usually, a user gets a 404 because they miss typed the URL to a page. The 404 the way you created it, wouldn’t even give them a clue as to how to find what they were wanted.
With all the time you’ve spent trying to figure this out, you could have copied the page to the 25 project files and been done.
It’s your site, just wanted to make sure new users realize the pitfalls of the approach you’ve taken.