Google Analytics 4: how to set it up and which reports to check as a business owner
Published
Step-by-step Google Analytics 4 setup for your website: property, data stream, tag, key events and reports that show leads.
We explain how permanent redirects differ from temporary ones, when you need them and how to configure them in .htaccess, Nginx or PHP.

A 301 redirect permanently redirects an old page URL to a new one. The server returns the 301 Moved Permanently status code, the browser immediately opens the new page, and Google recognizes the move as permanent. Over time, Google displays the new URL instead of the old one in search results. Use this redirect when a page has moved permanently: the domain has changed, the URL structure is different or a product has been replaced. Below, we explain when you need a 301 redirect, how it differs from other status codes and how to configure it.
Use a permanent redirect whenever an old URL stops working but still has incoming links or appears in search results. Common situations include:
If you delete a page and have no replacement, you do not need a redirect. Returning a 404 or 410 status code is more appropriate. Redirecting every deleted page to the homepage is a bad idea. Google may treat these redirects as soft 404 errors, and visitors looking for a specific product will simply leave.
Google's documentation divides redirects into permanent and temporary types. A permanent redirect tells the search engine to display the new URL. A temporary redirect keeps the old URL in search results.
| Type | How Google interprets it | When to use it |
|---|---|---|
| 301, 308 | Permanent, the new URL becomes the primary address | Permanent page or website migration |
| 302, 303, 307 | Temporary, the original URL usually remains in search results | Week-long promotion, website maintenance, A/B testing |
| Meta refresh with a 0-second delay | Permanent | When server settings are inaccessible |
| Meta refresh with a delay | Temporary | Almost never |
| JavaScript redirect | Google may miss it if the page fails to render | Only when other methods are unavailable |
The difference between 301 and 308 is technical: with a 308, the browser must repeat the request using the same method, such as POST. A 301 is more commonly used for regular website pages. The main rule in Google's documentation is to use a permanent redirect only when you are sure you will not reverse it.
Google does not forget the old URL immediately. According to Google's documentation, the search engine keeps both URLs after a redirect: one becomes canonical, while the other is treated as an alternative name for the same page and may still appear in search results for some time. This is normal and nothing to worry about.
Sometimes a rel="canonical" tag is more appropriate than a redirect. The difference is simple: a redirect sends both visitors and crawlers to the new page, while a canonical tag keeps both pages accessible and tells Google which one to display in search results. For example, the same product page may be accessible from two categories. Visitors can stay on the page they opened, so a canonical tag is more appropriate than a redirect.
The method depends on your server and CMS. Server-side redirects work best because they take effect before the page loads and are understood by both browsers and crawlers.
If your website runs on Apache, add redirect rules to the .htaccess file in the website's root directory. Here is a simple example for a single page:
Use the mod_rewrite module for URL patterns and conditions. For example, here is how to redirect an entire website to HTTPS:
Add a location block to the server configuration with the return 301 directive and the new URL. These settings are usually accessible to the server administrator or through the hosting control panel.
If you cannot access the server configuration, you can issue a redirect from your code using the header() function with the Location header and a 301 status code, then stop script execution.
Many content management systems have a redirect module or plugin that lets you enter old and new URL pairs into a table without editing files. This is convenient when you have dozens of redirects managed by a content manager.
Make a backup of your .htaccess file before editing it. A single syntax error can take the entire website offline with a 500 error.
Changing a domain or URL structure can require hundreds of redirects. The order of operations matters.
Google recommends keeping redirects in place for as long as possible, generally for at least one year. If you remove them after a month, old links from other websites and visitors' bookmarks will lead to nonexistent pages.
The easiest way to check whether a 301 redirect works is to open your browser's developer tools (F12), select the Network tab and load the old URL. The first row will show the response status code: 301 or 302. Running the curl -I command with the page URL gives you the same result. The URL Inspection tool in Search Console shows which URL Google considers canonical. To check redirects in bulk after a migration, use website crawlers that scan a list of URLs and display their response status codes in a table.
If you are moving to a new domain or your traffic has dropped after a redesign, request a website audit from UAH 3,500. We check redirects, redirect chains, 404 errors, your sitemap and internal links, then provide a table of recommended fixes.
If your website needs rebuilding, take a look at our website development services. We build new websites using our own WID CMS, and it is best to discuss the list of old URLs requiring redirects before development begins. For a detailed review of indexing and search rankings, request an SEO audit, also from UAH 3,500.
Rate this article
Published
Step-by-step Google Analytics 4 setup for your website: property, data stream, tag, key events and reports that show leads.
Published
What ChatGPT is, how to get started, how to write prompts, what tasks to delegate, and how its pricing plans differ.
Published
What CTR means, how to calculate it, how to compare your results in Google Ads, social media and Search Console, and how to improve it.
Published
What negative keywords are, how their match types work, where to find them and which mistakes to avoid to prevent wasting your ad budget.