Mobile app version of vmapp.org
Login or Join
Nimeshi995

: Will putting the HTML from a 301 redirect page into a document perform the same function as a real 301 redirect? In a web debugger, the html of a 301 redirect page shows up as: <!DOCTYPE

@Nimeshi995

Posted in: #301Redirect #Html

In a web debugger, the html of a 301 redirect page shows up as:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://www.website.com/webpage.htm">here</a>.</p>
</body></html>


I'm having to redirect html pages without server support. If I replace the pages html with the code above, will that work the same as writing 301 redirects in .htaccess on apache? I looked this up on google, but the sites talking about 301 redirects didn't cover this option for redirecting html pages.

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Nimeshi995

3 Comments

Sorted by latest first Latest Oldest Best

 

@Sent6035632

Agree with Hissohathair in that your approach will not actually redirect. Users may know to click the link, but the original page will still return a normal '200' status code and continue to show up on search results (probably not quite what you want).

In order to maintain page rank, 301 status codes are extremely important. Adding meta refresh tags is also a good option and may help in most cases (as per John's response), but you may not be guaranteed that the search engines will accept it as a 301 redirect in the future. Adding proper redirects to your .htaccess (or Apache conf files) would be your best option in order to guarantee the 301 status code is being sent.

Edit:

=======================

For an IIS7 website, as long as the IIS URL Rewrite module is installed, you can create redirect rules in the web.config for the site. These rules would apply to .html files as well. More info here:
learn.iis.net/page.aspx/461/creating-rewrite-rules-for-the-url-rewrite-module/
=======================

Another alternative if your web host does not have .htaccess/mod_rewrite capabilities might be to change the web host you are using where you can setup server-side redirects. As long as the site is properly moved, it should be fairly seamless to your users. This approach would only be for extreme cases if maintaining page rank is highly critical.

10% popularity Vote Up Vote Down


 

@Kimberly868

No, simply replacing the HTML with your example will not achieve the effect you're looking for. It will simply show that page to the user, since Apache will send a '200' status code along with it. Users will be able to click the link to find the page but it will not happen automatically and spiders will not know that you mean to effect a permanent redirection of the resource.

You will need to use a proper Redirect or _mod_rewrite_ directive in either .htaccess or your Apache conf files.

Alternatively, if you are actually using PHP or something similar you can set the return code to 301, output a Location response header and then your page based solution will work. In PHP it would look something like this:

<?php
header( "HTTP/1.1 301 Moved Permanently" );
header( "Location: www.new-url.com );

10% popularity Vote Up Vote Down


 

@Sarah324

Ideally you will send a 301 HTTP response status code. If you can't do that a meta refresh that is immediate will also work and be counted as a 301 or 302 redirect depending on the search engine.

<meta http-equiv="refresh" content="0;url=http://example.com/new.html">


The refresh rate must be zero for it to be considered a 30x redirect.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme