Solved

.htaccess 301 redirects - Is this the best way to do this?

Posted on 2015-02-06
3
83 Views
Last Modified: 2015-03-14
I need to 301 redirect all pages from an old website to our main website. The old website uses a custom CMS system and we do not have access to the server / not possible to configure redirects here.

My idea is to point the old website domain to our webserver and setup 301 redirects in the .htaccess file like this:

Redirect 301 /oldpage.html http://www.example.com/newpage.html

Open in new window


My question is, do I need to have actual html files in the site for the 301 redirects to work? Also, is my above code sound?

Thank You
0
Comment
Question by:Mark B
3 Comments
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 40594512
My question is, do I need to have actual html files in the site for the 301 redirects to work?

No.

Also, is my above code sound?

Yes, for a single page.  If the redirects are a predictable pattern (/oldpage.html to newsite.com/samepagename.html) you would probably want to use a single mod_rewrite rule to do it with a regular expression.
0
 
LVL 16

Accepted Solution

by:
Lucas Bishop earned 500 total points
ID: 40595851
Since you don't have access to the old server and the htaccess file you're editing here is on the local server, you don't actually need to include the domain name. Hence your code would be to the effect of:

Redirect 301 /oldpage.html /newpage.html

Open in new window


An easy way to go about this on a large scale, if the pages don't follow a common naming convention, would be to:
1.) Create a spreadsheet
2.) download a sitemap of your old site
3.) put old site page list in column A
4.) put new site page list mapping in column B
5.) Concatenate "Redirect 301 " to the front of Column A + Column B

Then you'll have a full listing of all your redirects you can paste into your htaccess
0
 

Author Closing Comment

by:Mark B
ID: 40665300
Thank you, this worked great.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

[Part 6 of a 6 part series called SEO Basics: 5 SEO Secrets for Creating Content that Drives Traffic (http://www.experts-exchange.com/Web_Development/Internet_Marketing/Search_Engine_Optimization_SEO/A_8369-SEO-Basics-5-SEO-Secrets-for-Creating-Cont…
Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now