Check that the hidden .htaccess file was copied, that the new server reads it and has URL rewriting turned on, then test every kind of page before the old hosting account closes.

One page works, the rest do not

A law office moves its website to a new host over a weekend. On Monday the home page looks perfect. Click About, Practice Areas or Contact, and each one says Not Found.

The files are all there, the database came across, and the home page proves the site is running. The pages behind it are missing anyway.

It is one of the commonest faults after a move, and it usually has nothing to do with the pages themselves.

How tidy page addresses work

Most content systems build their pages from a database, through one main file that answers every request. An address such as /about-us/ is not a folder on the server at all.

A small settings file named .htaccess tells the web server to hand those addresses to the system's main file. A server feature called URL rewriting carries out that instruction.

The home page works without either, because the server opens the main file for the bare domain by default. Every other address depends on the rewrite.

Why the move breaks it

The site worked on the old server, so something about the move changed. The usual causes are few.

The first is the most frequent. Files whose names begin with a dot are hidden on Mac and Linux computers, and many FTP programs leave them out of a transfer unless told to show hidden files.

Checking that the file arrived

Connect to the new server with an FTP program and turn on the setting that shows hidden files. The .htaccess file should sit in the same folder as the site's main files.

Compare it with the copy on the old server, line by line, while that account still exists. A missing file can be uploaded again from there.

On WordPress sites, saving the Permalinks settings page once rewrites the file if the server allows it. Joomla ships the file as htaccess.txt, which has to be renamed before rewriting works.

Confirming the server reads it

A quick test shows whether the server reads the file at all. A line of nonsense typed into .htaccess should produce a server error at once; if nothing changes, the file is being ignored.

Remove the test line straight away. If the file is ignored, or rewriting is off, the hosting company has to change a setting on its side.

The wording of the error page helps too. A plain server page saying Not Found means the request never reached the site; the site's own designed error page means it did, and the fault lies elsewhere.

A worked example

An auto wrecker outside Quesnel sells used parts from a yard of several hundred vehicles. Its site has a page for each make, a parts request form and a page about selling a car for scrap.

The site moved to a new host when the old plan came up for renewal. The home page loaded, but every make, the request form and the scrap page returned a plain Not Found.

The FTP program had copied every file except the one whose name starts with a dot, so the new server had no .htaccess at all.

With the file uploaded from the old account, the make pages returned. The parts request form still failed, because its settings pointed at a folder that existed only on the old server.

That path was corrected, and every kind of page was tested in turn: a make, a single listing, the form and its thank-you page, and an address that should not exist.

The order of the checks mattered. Fixing the missing file first exposed the second fault, which would otherwise have been blamed on the same cause and left in place.

Testing every kind of page

Testing the home page and one inner page proves little. Each kind of page can depend on different settings, so test one of each.

Try a normal page, a blog post, a category or archive, a search, each form through to its thank-you page, a file download, and an address that should not exist.

Log in to the administrator area and make a small edit too. Logins and uploads have their own ways of failing on a new server.

Before the old account closes

Keep the old hosting account open until the new site has passed every test and run for a week or two. It holds the original files and the working settings file.

Download a full backup of the old account, files and database, before cancelling it. A closed account's files are usually gone soon after.

The server's error reports

The hosting control panel usually offers a view of the server's error log. After a move, that log records every request that failed, including pages and files the tests missed.

Check it daily for the first two weeks. Requests from old links and search engines turn up there before any visitor complains.

The counter-case

A hand-built site made of individual HTML files does not use rewriting at all. Each page is a real file, so after a move it either arrived or it did not.

Sites like that can still lose an .htaccess file holding redirects or other settings, so the check takes a minute and is worth doing anyway.

For any site run by a content system, the hidden file and the rewrite are the first things to confirm, before anyone starts rebuilding pages that were never broken.

After the next move

  1. Show hidden files in your FTP program.
  2. Confirm .htaccess is on the new server.
  3. Compare it with the old server's copy.
  4. Ask the host whether rewriting is on and the file is read.
  5. Test one page of every kind.
  6. Read the error log daily for the first two weeks.
  7. Keep the old account until everything passes.

Step seven keeps every mistake reversible. While the old account exists, any missing file or setting can be copied across; once it is gone, it has to be rebuilt from memory.

The same error reports reveal files a theme keeps asking for that no longer exist, a problem traced in missing files that every page still asks for.


Frequently asked questions

Why does only the home page work after moving hosts?

The home page is served by default. Every other address depends on a hidden .htaccess file and URL rewriting, and one of them is missing or switched off.

Why did the .htaccess file not copy?

Its name starts with a dot, which hides it on many computers, and many FTP programs skip hidden files unless a setting tells them to show them.

How do I know the server reads the file?

Type a line of nonsense into it. If the site shows a server error, the file is read; remove the line at once. If nothing changes, it is ignored.

What if rewriting is turned off?

Ask the hosting company to turn it on for your account. On most servers it is a setting they control, not something you can change yourself.

Which pages should I test after a move?

One of every kind: a page, a post, an archive, a search, each form and its thank-you page, a download, a missing address and an administrator login.

When can I close the old hosting account?

After every test passes and the new site has run cleanly for a week or two. Download a full backup of files and database first.

West Coast Media Solutions Inc. provides web design, web development, hosting, digital marketing, and business consulting to organisations across Canada, drawing on more than twenty-five years in the field.

Pages missing since the move?

Tell us the address, and we will find whether the file, the setting or something else is at fault.

Start a Conversation