What It Is and The way to Use It

  • December 7, 2023
  • AI, SEO
No Comments

[ad_1]

What Is a 307 Redirect?

A 307 redirect (also known as “307 momentary redirect”) is an HTTP standing code that quickly diverts web site guests from one URL to a different. The 307 standing code is usually a great tool for web site upkeep, content material updates, and extra. 

However mismanaging it could result in:

  • Web site errors
  • Decrease rankings on search engine outcome pages (SERPs)
  • Poor person expertise

On this article, you’ll find out how the 307 redirect works, when to make use of it, easy methods to set it up, and a few finest practices. 

We’ll additionally clarify 307 inside redirect, which isn’t an HTTP standing code however performs a task in web site safety. 

Let’s begin by trying on the wider household of 3xx standing codes.

Understanding the 3xx Standing Codes

All HTTP standing codes with a 3xx quantity take care of URL redirection.

How do they work?

When somebody tries to entry your webpage, their browser forwards a “request” to your web site’s server (a system that hosts and delivers internet content material).

The server responds with a message indicating the web page’s standing. This message is known as an HTTP standing code.

How the URL redirections work

If there’s a cause for the browser to be guided to a distinct location, the server sends a 3xx standing code.

Listed below are the 3xx codes in simplified type:

  • 300 a number of selections: The browser can select between a number of choices for the requested web page
  • 301 moved completely: The requested web page has a brand new everlasting tackle
  • 302 discovered: The requested web page has a brand new tackle for a short while
  • 303 see different: After an motion like submitting a type, the person is shipped to a different web page to stop duplicate submissions
  • 304 not modified: The requested web page hasn’t modified because the person’s final go to, so the browser can use its cached model
  • 307 momentary redirect: The requested web page is quickly at a distinct tackle
  • 308 everlasting redirect: The requested web page has moved completely

The 302, 303, and 307 codes are momentary redirects. So how are they totally different?

302, 303, and 307 Redirects: What is the Distinction?

There are three kinds of momentary 3xx redirects: 302, 303, and 307. Every has a singular operate.

The primary distinction between these redirects is how they deal with GET and POST requests—two frequent kinds of requests despatched by a browser to a server when a person tries to entry a webpage:

  • GET: When a person solely desires to view a web page
  • POST: When a person desires to ship knowledge to the server (e.g., when submitting a type)
URL redirects explained in an infographic

302 Redirect

When a person tries to submit a type or different knowledge (a POST request), the 302 redirect may change the request to a GET request.

This will battle with the person’s intention.

As an example, if a person is making an attempt to join a e-newsletter, their e-mail may not be added to the subscription checklist as a result of change in request kind.

303 Redirect

The 303 standing code turns all request varieties right into a GET request. It’s thought of momentary as a result of it’s tied to solely considered one of a number of actions out there to a web site customer, resembling submitting a type.

After a type submission, the 303 code sends the person to a distinct location utilizing a GET request. This avoids the danger of resubmission if the person hits the refresh button. 

However by turning all request varieties right into a GET request, the 303 standing code can battle with the person’s intent. Because of this the 303 redirect isn’t broadly used.

307 Redirect

Not like the 302 and 303 codes, the 307 redirect maintains the integrity of the unique request methodology. A POST request, for instance, stays a POST request after the redirect.

Sustaining the right request kind ensures that type submissions and different despatched knowledge attain their supposed vacation spot and permits the web site to raised shield delicate person info.

Though all three redirects point out a brief transfer, the 307 standing code is your best option, particularly when knowledge submission is concerned.

302, 303 and 307 redirects explained

307 Momentary Redirect vs. 307 Inside Redirect

A 307 momentary redirect is a server-side instruction that tells browsers to quickly redirect site visitors from one URL to a different. It is a short-term measure.

A 307 inside redirect is not an official HTTP standing code however is usually utilized in internet server configurations. It’s a browser-initiated redirect for a really particular function: to direct guests away from the HTTP model of your web site to the safer HTTPS model. 

It’s a everlasting safety measure to guard person knowledge.

When somebody visits your web site, their browser communicates along with your web site’s server. This communication could be:

  • HTTP: A plain-text communication protocol
  • HTTPS: An encrypted communication protocol, the place the “S” stands for “safe”
HTTP and HTTPS communication with the website's server explained

Each web site has a non-secure HTTP model. However should you’ve carried out safety practices, you’ve an HTTPS model, too.

Nonetheless, simply having an HTTPS web site is not sufficient. Guests may nonetheless land in your HTTP web site. To stop this, you want a seamless redirect to your HTTPS model. That is the job of the 307 inside redirect.

By enabling HSTS (HTTP Strict Transport Safety), you may set off these 307 inside redirects in a customer’s browser.

HSTS is a safety characteristic that instructs browsers to all the time use HTTPS as an alternative of HTTP.

The outcome: When a person tries to entry your web site through HTTP, the browser mechanically redirects them to the HTTPS model.

Utilizing the 307 inside redirects through HSTS ensures that customers’ knowledge stays encrypted and safe from potential threats.

307 temporary redirect vs 307 internal redirect

The way to Set Up a 307 Redirect

There are a number of methods to implement a 307 redirect. The strategy of selection will depend on your web site’s platform (e.g., WordPress, Joomla, custom-built), your technical experience, the instruments you are comfy with, and your particular targets for the momentary redirect.

Listed below are the three commonest strategies:

1. Enhancing the .htaccess File

The .htaccess file is a configuration file primarily utilized by Apache internet servers.

This file instructs your server how to answer numerous eventualities, together with redirects.

You’ll be able to implement a 307 redirect by modifying this file.

Amongst different advantages, the .htaccess file provides you centralized management. You’ll be able to conveniently handle all of your redirects from this single file. Different strategies require organising every redirect individually.

Log in to your web site’s internet hosting account. Then navigate to the basis listing, which is your web site’s major folder.

For instance: If Bluehost is your hosting supplier, your root listing will look one thing like this:

"public_html" root directory highlighted in Bluehost

Find the .htaccess file contained in the “public_html” folder. Open it to edit.

".htaccess" file highlighted under the "public_html" folder

Now do the next:

  • Examine if “RewriteEngine” is on. You may see a line within the file that claims RewriteEngine On. (See the screenshot beneath) If it isn’t there, it’s essential add it.
  • Add the next code on the finish of the .htaccess file: 

Redirect 307 /oldpage.html /newpage.html 

Ensure that to exchange /oldpage.html with the trail of the web page you are redirecting from and /newpage.html with the vacation spot web page’s path.

"RewriteEngine On" and "Redirect 307 /oldpage.html /newpage.html" highlighted

Save the file. And take a look at to see whether or not the redirect is working correctly.

In case you are utilizing a server kind aside from Apache (e.g., Nginx or IIS), the method is totally different. However the precept stays the identical: You may must edit a configuration file particular to that server. 

Ensure that to test your server’s documentation or search knowledgeable recommendation.

2. Plugins

Does your web site use a content material administration system (CMS) resembling WordPress? Then implementing a 307 redirect is simple through a plugin.

Merely seek for a redirection plugin in your CMS’s plugin retailer or on third-party platforms.

Set up and activate the plugin. Then comply with its directions.

Let’s take WordPress for example.

The Redirection plugin is a well-liked free answer for dealing with your redirects.

Log in to your WordPress dashboard. Click on “Plugins” within the sidebar, seek for “redirection,” and activate it.

"Redirection" widget highlighted on WordPress plugins dashboard

Then head to “Instruments” > “Redirection” to open the plugin.

Navigating to "Redirection" plugin in WordPress

Now enter your 307 redirect guidelines.

Adding 307 redirect rules to the "Redirection" plugin

Additional studying: The way to Redirect URLs on WordPress

3. Programming Languages

Programming languages supply a extra hands-on method to organising redirects. 

This methodology is right in order for you direct management over how and when redirects occur. Programming languages allow you to redirect customers based mostly on particular actions they take or particulars they supply.

In addition they enable for quicker and extra built-in setups with out the necessity for added instruments or plugins.

PHP and JavaScript are two fashionable languages. Right here’s how you need to use them to implement 307 redirects:

Redirects in PHP

PHP is a server-side scripting language generally utilized in internet growth. 

To arrange a 307 redirect utilizing PHP, use the “header()” operate to ship a location header to the browser, instructing it to redirect to a brand new URL.

Open the PHP file from which you wish to redirect.

On the high, earlier than any content material, insert:

<?php
header("Location: /new-url/", true, 307);
exit;
?>

Substitute /new-url/ along with your desired vacation spot.

Save the file and take a look at the redirect by accessing the unique web page.

Redirects in JavaScript

JavaScript is a client-side scripting language. 

Establishing redirects in JavaScript is not as Search engine optimization-friendly as server-side strategies. 

The redirects happen solely after the web page begins loading, thereby inflicting a delay. And never all serps execute JavaScript or achieve this constantly.

Discover the HTML file of the web page you want to redirect.

Within the <head> part of your HTML file, ideally above “</head>.”

Insert the next script:

<script kind="textual content/javascript">
window.location.exchange("/newpath/");
</script>

Substitute “newpath” along with your desired vacation spot URL. For instance, if you wish to redirect to a web page with the URL https://yourwebsite.com/about-us, you’ll exchange /newpath/ with /about-us/.)

Save your adjustments to the HTML file. Then take a look at the redirect by accessing the unique web page.

Now that some methods to implement a 307 redirect, when is it crucial? 

When to Use a 307 Redirect

Web site Upkeep

Use a 307 redirect for pages which might be unavailable for a restricted time as a result of updates or upkeep. In any other case, guests will see an error message.

Merely take away the redirect as soon as the upkeep is full.

A/B Testing

Suppose you’ve got redesigned your touchdown web page. And also you wish to see if it engages your viewers higher than the present model.

For this experiment, you may resolve that for a restricted time, all incoming site visitors to the unique web page ought to be redirected to the brand new design utilizing a 307 redirect.

Throughout this era, all guests will expertise the brand new design.

As soon as your A/B take a look at is over, you may make the brand new design everlasting based mostly on optimistic outcomes. Or revert to the unique structure if it proves more practical.

Momentary Content material Relocation

Suppose you’ve got hosted a weeklong on-line occasion with a devoted touchdown web page. After the occasion, you want time to investigate engagement and collect suggestions.

Throughout this interim evaluation section, you don’t need guests to entry the occasion web page straight.

You’ll be able to quickly divert guests to a associated abstract web page utilizing a 307 redirect.

When you’re able to showcase the occasion’s outcomes, highlights, or any post-event content material, you may take away the 307 redirect, permitting guests to entry the up to date occasion web page.

Transitioning Between HTTP and HTTPS

While you safe your web site by transferring from HTTP to HTTPS, you will use the HSTS characteristic.

HSTS tells browsers to all the time use HTTPS as an alternative of HTTP.

If a person tries to entry the HTTP model of your web site, the browser will mechanically use an inside 307 redirect to take them to the safe HTTPS model.

This ensures an encrypted connection, defending their knowledge.

When To not Use a 307 Redirect

For Everlasting URL Adjustments

In case you’ve completely moved a web page to a brand new URL, a 307 momentary redirect is not proper. 

As a substitute, it’s best to use a 301 everlasting redirect to sign the change to serps.

You should use Semrush’s Web site Audit device to determine pages in your web site with 307 redirects. After which change them to 301 if these pages have been completely moved.

Open the device, enter your area, and click on “Begin Audit.

Site Audit tool search

As soon as the audit is full, open the “Overview” report and search for the “Crawled Pages” widget. Click on on the variety of “Redirects.”

"Crawled Pages" widget highlighted on the Site Audit overview dashboard

Evaluate all of the URLs with a 307 standing code. If any of those pages have been completely moved, implement 301 redirects. Confer with our information on organising 301 redirects utilizing an .htaccess file.

Crawled pages report in Site Audit tool

You too can apply an HTTP Standing filter to this report back to see solely pages with a “3xx momentary” standing code.

"3xx temporary" status code selected under "HTTPS Status Code" filter under "Crawled Pages" report

For Bulk Redirects

In case you’re restructuring your complete web site or altering its area, utilizing particular person 307 redirects for every web page could be inefficient and will decelerate your web site’s loading time.

From an Search engine optimization perspective, extreme particular person redirects can confuse search engine crawlers, doubtlessly impacting your web site’s rankings.

As a substitute of individually redirecting every web page, it is extra environment friendly to make use of “wildcards” or “pattern-based redirects.”

These shortcuts mean you can redirect a number of comparable URLs through a single rule.

For instance, you need to use the sample “/weblog/*” to redirect all pages underneath the “/weblog/” listing to a brand new location.

Search engine optimization Implications of 307 Redirects

Now that when and when to not use a 307 redirect, you must also concentrate on its Search engine optimization implications. Here is a fast breakdown:

  • How hyperlink juice transfers: 307 redirects could quickly move on the unique web page’s Search engine optimization worth to the redirected one. However as a result of this can be a momentary redirect, serps count on the unique URL to be accessible once more sooner or later. Because of this, the Search engine optimization worth is not transferred completely.
  • How 307 and 302 redirects are handled by serps: Each are momentary redirects, and their Search engine optimization affect is comparable. The important thing distinction is in how they deal with browser requests—not of their switch of Search engine optimization worth.

When utilizing 307 redirects, make sure to think about their potential affect on Search engine optimization. Managing them appropriately will keep away from errors and assist keep the SERP rankings of your URL.

Greatest Practices for 307 Redirects

There’s loads to think about when dealing with 307 redirects. Comply with these finest practices to make sure optimum outcomes: 

Check All Redirects

After organising a 307 redirect, all the time take a look at it to make sure it is working as supposed.

To take action, merely go to the previous URL and test whether or not it easily redirects to the specified new location.

Monitor Redirect Efficiency

Repeatedly test the efficiency of your redirects. You should use analytics to watch how customers are interacting with redirected pages.

In case you discover any anomalies or elevated bounce charges, it may be time to re-evaluate your redirect technique.

Evaluate and Replace

As your web site evolves, some 307 redirects could now not be crucial.

Periodically evaluation your 307 standing code to test for errors (also known as a “307 error code” when the redirect is not working appropriately). And repair them—both by updating or eradicating them.

Restrict Redirect Chains

Keep away from creating chains of redirects (e.g., Web page A redirects to Web page B, which then redirects to Web page C, and so forth).

This will sluggish the web page’s loading time and create a poor person expertise. Intention for direct, one-step redirects every time attainable.

You should use Semrush’s Web site Audit device to determine redirect chains that want fixing. Audit your web site. Then head to the “Points” tab of your report.

You’ll now see all the problems Semrush discovered in your web site. Together with any “redirect chains and loops.”

“redirect chains and loops" issues highlighted under "Issues" tab in Site Audit tool

Evaluate and repair the problem. Intention to have every hyperlink redirected solely as soon as.

Hold Person Expertise in Thoughts

If a redirect results in a web page that is not related or does not meet the person’s expectations, it could trigger dissatisfaction.

So all the time think about the person’s perspective. Make sure that your redirects result in related, high-quality content material.

Keep away from Frequent URL Adjustments 

Utilizing 307 redirects regularly on the identical URL can ship blended alerts to serps. 

When serps detect {that a} explicit URL’s vacation spot is regularly altering, they may develop into unsure in regards to the stability and relevance of that content material. 

Because of this, the search engine may not rank the content material extremely.

So use redirects judiciously. And make sure that content material stays constant for optimum search efficiency.

Prioritize Safety

In case you’re utilizing redirects as a part of a transition to HTTPS, make sure that all points of your web site are safe. This prevents “blended content material” vulnerabilities.

What do you have to do?

Examine whether or not your web site’s exterior sources, plugins, and scripts are appropriate with HTTPS. If not, exchange them.

Doc Your Redirects

Hold observe of your energetic redirects to assist with future troubleshooting and to maintain future web site managers knowledgeable. 

The way to Repair 307 Momentary Redirect Points

It’s straightforward to implement a 307 redirect. Nonetheless, you should still face sure points or misconfigurations. Listed below are some frequent options:

Examine Server Configuration

Checking your server configuration helps you guarantee all redirect guidelines are functioning as supposed.

For instance, suppose you wished to arrange a redirect for an previous product web page to a brand new one. In case you mistakenly set the rule to redirect customers to a web page that now not exists or to an unrelated part of your web site, guests will encounter errors or confusion.

To keep away from such errors, repeatedly evaluation the redirect guidelines in your server settings. Ensure that they’re pointing to the right locations. These settings are usually accessible and adjustable in your internet hosting supplier’s management panel.

Evaluate Server Logs

Analyzing server logs can assist you determine the basis causes of surprising 307 redirects. By analyzing these logs, you may:

  • Decide which URLs are regularly inflicting redirects. This can assist if sure pages are misconfigured or if there’s an error within the redirect guidelines.
  • Spot any surprising configurations or adjustments which may have triggered the redirect. That is particularly helpful if there’s been a current replace or if a number of folks have entry to your server settings.
  • Acknowledge patterns of person habits or particular occasions resulting in the redirect, resembling type submissions or the accessing of outdated hyperlinks.

As soon as you’ve got recognized the basis causes, you may take the required steps to repair the problems.

Different Fixes

  • Make sure that the URLs arrange for redirects are appropriately configured. A misconfigured URL in your redirect guidelines can result in surprising habits.
  • In case your web site has caching mechanisms in place, make sure that they aren’t caching outdated redirects. You may must clear or replace server-side caches.
  • In case you’re utilizing a CMS or a selected internet platform, test its documentation. Some platforms may need anomalies in how they deal with redirects, or there may be identified points with sure plugins or configurations inflicting surprising 307 redirects.
  • In case you’re dealing with complicated redirect loops, a number of redirects chaining collectively, or different eventualities that you could’t resolve, think about searching for assist from an internet developer or server knowledgeable

Use 307 Redirects the Proper Means

Now that you simply perceive what a 307 redirect is, the way it works, and easy methods to implement it, let’s get to work.

Audit your web site utilizing a device like Web site Audit, and get a full report on all of your redirects.

Evaluate the URLs with the 307 standing code. And decide:

  • Are they appropriately used and pointing to the best vacation spot?
  • Do they want an replace to a distinct HTTP standing code?
  • Are there any dangerous redirect configurations, like chain redirects?
  • Must you take away the redirect?

Primarily based in your evaluation, make adjustments accordingly.

[ad_2]

Supply hyperlink

About us and this blog

We are a digital marketing company with a focus on helping our customers achieve great results across several key areas.

Request a free quote

We offer professional SEO services that help websites increase their organic search score drastically in order to compete for the highest rankings even when it comes to highly competitive keywords.

Subscribe to our newsletter!

More from our blog

See all posts

Leave a Comment