Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
Thread Tools Display Modes
Share |
  #1  
Old 09-03-2014, 02:55 AM
SublimeSEO's Avatar
SublimeSEO SublimeSEO is offline
Junior Member
 
Join Date: 03-26-14
Posts: 34
iTrader: 0 / 0%
Lightbulb How to 301 redirect all inner pages to homepage in HTML

Hi guys, so I bought an aged domain with dozens/hundreds of inner pages (that don't exist anymore basically). I will be setting up an HTML website (I usually just use Wordpress).

There is plugin in WP that redirects all inner pages (that give 404 error) to homepage by using 301 redirect (https://wordpress.org/plugins/link-juice-keeper/). Other plugin for this is https://wordpress.org/plugins/404-to-start/.

So, how can I do this if I'm not using WP, but just setting up an HTML website? I need to redirect all inner pages with 301 back to homepage because I need to transfer link juice from all those pages back to homepage.

Thank you in advance!
 
Reply With Quote

Advertisement

Advertisement

  #2  
Old 09-03-2014, 03:50 AM
Bhavna Bhavna is offline
Contributing Member
 
Join Date: 07-16-14
Location: India
Posts: 70
iTrader: 0 / 0%
you can use 301 redirection through .htaccess file and can also use metatag for the same task to do.
 
Reply With Quote
  #3  
Old 09-07-2014, 11:35 PM
arunthomas203 arunthomas203 is offline
Contributing Member
 
Join Date: 06-24-14
Posts: 68
iTrader: 0 / 0%
Can you try this in .htaccess

Code:
RewriteEngine on RewriteCond %{REQUEST_URI} !^/index.html$ RewriteCond %{REQUEST_URI} !\.(gif|jpe?g|png|css|js)$ RewriteRule .* /index.html [L,R=302]
 
Reply With Quote
  #4  
Old 09-08-2014, 12:01 AM
freelance-developer's Avatar
freelance-developer freelance-developer is offline
Contributing Member
 
Join Date: 03-28-14
Posts: 105
iTrader: 0 / 0%
IIS Redirect

In internet services manager, right click on the file or folder you wish to redirect
Select the radio titled "a redirection to a URL".
Enter the redirection page
Check "The exact url entered above" and the "A permanent redirection for this resource"
Click on 'Apply'

ColdFusion Redirect
<.cfheader statuscode="301" statustext="Moved permanently">
<.cfheader name="Location" value="http://www.new-url.com">

PHP Redirect
<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.new-url.com" );
?>

ASP Redirect
<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location","http://www.new-url.com/"
%>

ASP .NET Redirect
<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","http://www.new-url.com");
}
</script>

JSP (Java) Redirect
<%
response.setStatus(301);
response.setHeader( "Location", "http://www.new-url.com/" );
response.setHeader( "Connection", "close" );
%>

CGI PERL Redirect
$q = new CGI;
print $q->redirect("http://www.new-url.com/");

Ruby on Rails Redirect
def old_action
headers["Status"] = "301 Moved Permanently"
redirect_to "http://www.new-url.com/"
end
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to redirect 404 all pages to Homepage Lahori_Munda Coding Forum 20 04-11-2014 02:38 PM
301 redirect to homepage ? Indie SEO Forum 7 08-14-2012 07:57 AM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 12:08 AM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC