How to redirect a web page, the smart way
The internet today is full of webmasters that are always updating, editing and even deleting web pages.
Lets say you are updating your website completely, changing the names of page's filenames (ex: file.html to file.php) and so on, this is great, you should stay updated! But what if you want to get rid of those old pages without having to worry about those who go to the old web page and see nothing? It doesnt end there either, other visitors do include major search engines such as MSN, Google and Yahoo! If people are finding your old pages when querying in these search engines, and they attempt to go to that page that has been deleted or moved, they will get a "404 File Not Found" Error! Now i know you dont want that, no webmaster wants that!
UPDATE: For those of you still confused on what web page redirection is, I have written a follow-up article titled Understanding Web Page Redirection, the smart way, to help answer some of the questions I most commonly get in the comments of this article.
The 301 Redirect
The best way to redirect those pages is by using something called a "301 Redirect". What this 301 redirect does, is it blatantly redirects to a different page when it is triggered. What makes the 301 redirect the best? Not only does it accomplish your redirect - it does it safely. No having to worry about the search engines penalizing you for it. To be specific, the 301 redirect tells the browser, or in other cases, it tells the search engines "Hey this page has been moved, here is the correct URL!". Think of it as you getting mail that is not addressed to your name. Possibly addressed to somebody who has lived there prior to yourself. What do you do? You tell the post man (or woman) "Hey they don't live here anymore, here is the correct address". It is the same concept, pretty simple stuff.
So lets get started. Below you will see several methods of using the 301 redirect, including the redirect in PHP, the redirect in ASP, the redirect in ASP .NET, the redirect in JSP (JAVA), the redirect in IIS, the redirect in ColdFusion, the redirect in CGI/PERL and finally the one I find most useful, the redirect using htaccess. Also showing other useful ways of using the 301 redirect with mod_rewrite!
HTML Redirection
How do you redirect using html you ask? Here is how: DONT!
Over the past 8-10 years, use of meta tag refresh redirection has been abused for uses in relation to SPAM. The result of this and other scenarios of mis-uses of it, is that when using it, that page WILL be de-indexed from every search engine.
NOTE: This also applies to javascript redirection. Search engines can easily detect javascript and meta tag redirection, so just dont do it, use the 301 redirect.
Now, this doesn't necessarily apply to *everything*. If it is used properly, then you have nothing to worry about. For example, often on many forum engines - you will see when you perform different tasks such as making a thread, replying to one or even things like logging in - you will notice it takes you to a "please wait a moment" screen. On those types of pages, they are using either javascript or meta tag redirection, and its perfectly legit.
Canonical Links
My first impression of canonical links is "Great, but where the hell were you 10 years ago?". That aside, from what I see they really are for one purpose: dynamic content.
To put that into perspective, I have a wordpress plugin on this blog that will separate my comments onto multiple pages, so I don't have to show 500+ comments on one single page. So it paginates the comments for me.
The slight drawback to this, is that since it is paginating my comments onto several pages - this exact article data exists on those pages as well. So those page url's end up looking like this: http://www.stevenhargrove.com/redirect-web-pages/comment-page-50/. When really, it is just the same page with different comments.
Using canonical links, I could specify in the
of the html document my canonical link. Which would look like this:-
<link rel="canonical" href="http://www.stevenhargrove.com/redirect-web-pages/" />
Another interesting bit to consider about canonical links:
Can this link tag be used to suggest a canonical URL on a completely different domain?
No. To migrate to a completely different domain, permanent (301) redirects are more appropriate. Google currently will take canonicalization suggestions into account across subdomains (or within a domain), but not across domains. So site owners can suggest www.example.com vs. example.com vs. help.example.com, but not example.com vs. example-widgets.com.
Matt Cutts has a great article that shows how to use these more in depth. He also has a slide show that covers it a bit.
301 Redirect Using htaccess
Using htaccess to accomplish the 301 redirect is highly suggested due to it being fairly convenient to manage, rather than setting redirects on each individual page, you can simply add the redirect code to the .htaccess file.
Here is how to do it:
- Create a file on the root directory of your website, name it ".htaccess".
- Open the .htaccess file using notepad or what ever text editor that you prefer.
- Add this into the .htaccess file, save it and then upload it to your web server:
CODE:
-
Redirect 301 /old/old.html http://www.you.com/new.html
-
NOTE: Don't add "http://www" to the first part of the statement - place the path from the top level of your site to the page. Also ensure that you leave a single space between these elements:
redirect 301 (the instruction that the page has moved) /old/old.html (the original folder path and file name) http://www.you.com/new.html (new path and file name)
Also note that you are not required to redirect the page to another domain, an equally useful purpose for using the 301 redirect, is redirecting old pages to the new pages on the same domain, it all works the same way!
UPDATE: .htaccess Editor is a simple, yet useful resource for generating htaccess files.
301 Redirect Using Mod_Rewrite
Mod_Rewrite has got to be one of the most usefull modules a server can have in terms of SEO, it allows to organize the file structure of your web site in a dynamic yet simple fashion, in this example I show a useful method of 301 redirecting with mod_rewrite.
When somebody links to your website, sometimes they dont always link to you in the way that you want them to. If somebody links to www.yoursite.com and somebody else links to yoursite.com, Google will assign a separate pagerank for each of those. Yes, it is stupid but it is true, by inserting the below example into your .htaccess file, it will solve the problem by redirecting anything linking to yoursite.com to www.yoursite.com, also redirecting the pagerank, so no worries!
-
RewriteEngine On
-
rewritecond %{http_host} ^yoursite.com
-
rewriteRule ^(.*) http://www.yoursite.com/$1 [R=301,L]
301 Redirect Using IIS
- 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 page that the page will be redirected to.
- Check "The exact url entered above" and the "A permanent redirection for this resource".
- Click on 'Apply'.
301 Redirect Using ColdFusion
As well as many server side scripting languages, using the 301 redirect in them is fairly simple.
Simply add this code to your ColdFusion page:
-
<cfheader statuscode="301" statustext="Moved permanently">
-
<cfheader name="Location" value="http://www.new-url.com/">
301 Redirect Using PHP
Simply add this code to your page or script:
301 Redirect Using ASP
Simply add this code to your page or script:
-
<%@ Language=VBScript %>
-
<%
-
Response.Status="301 Moved Permanently"
-
Response.AddHeader "Location", "http://www.new-url.com/"
-
%>
301 Redirect Using ASP .NET
Simply add this code to your page or script:
-
<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>
301 Redirect Using JSP/JAVA
Simply add this code to your page or script:
-
<%
-
response.setStatus(301);
-
response.setHeader( "Location", "http://www.new-url.com/" );
-
response.setHeader( "Connection", "close" );
-
%>
301 Redirect Using CGI/PERL
Simply add this code to your cgi/perl script:
-
$q = new CGI;
301 Redirect Using Ruby/Ruby on Rails
Simply add this code to your ruby/ruby on rails script:
-
head :moved_permanently, :location => "http://www.domain.com/
Zachary Pinter has a nice explanation of this.
Pleaee note that all of the snippets of code above are examples and I have tested each at some point. However, I am in no way responsible for any damage the code may cause, you use this code at your own risk.

iitians said,
March 13, 2010 @ 12:37 pm
Hey thank you so much for this information . i was looking for it .,very very useful .:)
letterheads said,
March 12, 2010 @ 8:32 am
I love this blog, its one of the best on the web
ffxiv gil said,
March 8, 2010 @ 11:49 am
I wish getting over a broken heart can be so easy as following a few steps.. but its not?:(
Christine Lee Smith said,
March 8, 2010 @ 4:25 am
Steve,
You are the man! I can’t say thank you enough for this post. Saved me hours of sitting behind my computer trying to figure out what to do now that Blogger’s discontinued http://FTP.
Again, thank you!
-Christine
Kelly Meja said,
March 4, 2010 @ 9:42 pm
Hi, I came across this blog article while searching for help with JavaScript. I have recently switched browsers from Google Chrome to Mozilla Firefox 3.1. Now I seem to have a issue with loading JavaScript. Every time I go on a website that needs Javascript, the site doesn’t load and I get a “runtime error javascript.JSException: Unknown name”. I can’t seem to find out how to fix the problem. Any help is greatly appreciated! Thanks
Steve Brickle said,
March 3, 2010 @ 7:36 am
Hi there,
Whilst this works fine if people just type in the domain of the old site, it does not seem to work if they type in oldsite/directory.
They still see the index page in that dir. I have tried putting in something similar in the directory in question, but do not get the same effect….any thoughts. Thanks in advance
nikki said,
March 2, 2010 @ 2:03 pm
Steven - Thanks for taking the time to explain this in such detail!
I just came from a site that recommended using the meta html refresh. I wasn’t aware of the consequences.
I’m going to redirect using the .htaccess file … at my own risk
Thanks again!! ~nikki
Urban Classics said,
March 1, 2010 @ 8:42 pm
301 redirect is the most efficient and Search Engine Friendly method for webpage redirection. It’s not that hard to implement and it should preserve your search engine rankings for that particular page. If you have to change file names or move pages around, it’s the safest option. The code “301″ is interpreted as “moved permanently”.
I like that…
ASP Redirect
Ravi said,
February 27, 2010 @ 6:36 pm
I was looking for instructions using .htaccess file for redirection.
Thanks for the detailed info.
Desserts Recipes said,
February 26, 2010 @ 11:28 am
Hey, nice blog. I’m having a small problem though, I cant seem to be able to subscribe to your rss feed
I’m using google reader by the way. Can you pleasse check what is wrong and try correcting it?
Zack Covell said,
February 25, 2010 @ 10:29 pm
Hi Steven,
I used the .htaccess 301 redirect method and now my site is Live, but it’s broken.
Can you please advise?
Where do I begin to look for help to resolve my issue on my blog now?
http://www.zackcovell.com
503-325-2858
Иван said,
February 24, 2010 @ 9:44 pm
Приятный сайтег и геста удобная, так что респект автору!
biker leather jacket said,
February 24, 2010 @ 11:29 am
If you svn export then you can’t commit changes from the live site back to the repository.
Umzug München said,
February 23, 2010 @ 7:43 pm
Hello, Very good article. I will continue to pursue this article, as it is written is very interesting. Since we are interpreted very much on good information. Best regards
Sam internet jobs said,
February 22, 2010 @ 3:00 am
I can relate to this really easy, thank you. I have subscribed to your RSS.
vinyl letters said,
February 20, 2010 @ 7:21 am
im having a problem with where to place redirect code can you help me out??? thanks i been going at it for weeks now but im stuck…
Иван said,
February 19, 2010 @ 9:33 pm
Очень даже занимательный проект, добавил в избранное!
piticu said,
February 16, 2010 @ 2:07 pm
Mod_Rewrite worked like a charm. Thank you!
Colin said,
February 13, 2010 @ 5:53 pm
Nice one, it worked…. Thanks a billion
Steve said,
February 12, 2010 @ 7:44 am
Hi Steve,
This article has cleared up a lot or redirect questions which I had, thanks for the clear and precise advice.
Van said,
February 12, 2010 @ 12:25 am
Does not work on sub directories? URL in browser does not change to
http://www.domain.com/subdir/test.html
when calling to
http://domain.com/subdir/test.html
Does it for you?
Speed Demon said,
February 4, 2010 @ 11:24 pm
I would also like to know how long does one keep the 301 going? Is it months or years? If old links continue to point to the old one, I guess you just loose those a few years after your move.
Ralph Bass said,
February 1, 2010 @ 7:29 pm
If I redirect from my old site to a new web site with 301 Redirect Using htaccess, do I put this .htaccess document on the old site? I think the answer is yes. That being the case, do I need to continue to pay hosting fees (forever) to keep this site up so it does the redirect for me to my new site (hosted somewhere else)?
Ralph
matt said,
January 28, 2010 @ 8:32 am
Hi Steve,
Useful article, thanks.
I noticed your example of a canonical link differs from all the Google examples.
i.e.
is not a specific file as per the Google examples. Are you sure this will work?
Can it be tested?
Also I was wondering whether it is possible to do a canonical link for a CNAMEd subdomain. i.e. I have a subdomain images.mattconsidine.com which I point to my subdirectory on photoshelter but I want the indexing to be on the images.mattconsidine.com, so I set up a canonical link saying images.mattconsidine.com is the prefered domain.
jehzlau said,
January 26, 2010 @ 6:24 am
wooot.. the Redirect 301 for individual page didn’t work for me
sugitha said,
January 25, 2010 @ 8:29 am
Great article about 301 redirection, Thank you Steve.
jd webb said,
January 25, 2010 @ 12:20 am
Hey, I just wanted to drop a note and say nice post!
Chris said,
January 14, 2010 @ 1:08 pm
If I am switching over server types from Linux/PHP to windows/asp and its on a shared hosting and cant use IIS to do 301’s what can i do?
Lana Galileo said,
January 14, 2010 @ 5:39 am
But how do you redirect using .htaccess dynamic links to static ones, i have mod rewrite them but this links are not redirected, when someone gets on dynamic link he is not redirected to static link. Any ideas?
bren said,
January 13, 2010 @ 7:41 pm
I am attempting to do an htaccess redirect. When I create the file using notepad, it automatically creates a file extension of txt. How do you omit the file type extension?
watch when in rome online said,
January 13, 2010 @ 12:07 am
This is a very good article. It seems like you did you research and it is very informative.
Angela said,
January 7, 2010 @ 3:28 pm
Awesome! Used .htaccess and it worked perfectly! Did exactly what I needed. Thanks for posting this info.
Janet said,
January 6, 2010 @ 3:56 am
Need help please. Look I have ZERO knowledge about these things, I have used a template/builder for all of my site. I recently switched builders/hosts to offer more features to my customers.
And I have a big problem with all of my previously indexed items now coming up as 404 errors.
I don’t understand these codes, or which one I am to use to get this 301 direct.
Would anyone be willing to take a look at my builder and help me please? I will glady place a link to your services on my site in exchange for your help.
THANKS
Janet
galla15@verizon.net
wiifan2012 said,
January 3, 2010 @ 10:51 am
Thanks! Used the php one and worked as describe
Redirected my main directory to my /home folder; where my site is now.
Indexed By Google said,
January 3, 2010 @ 1:33 am
HmI hadn’t never thought the ultimately simple ways a search engine like Google worked in. The truth of the affair is that while Search Engines “indexes” your page countless times, it still takes a metric tonne of effort on your part to get your site to become relevent to the spiders. This will add to my understanding of Google.
NineHats said,
December 30, 2009 @ 12:33 pm
I really like this article. I plan on trying it out later. I like your simple explanation of using the .htaccess file. Do you know if modifying the current .htaccess file in my wordpress site will cause any problems with wordpress?
Thanks again.
Rufus Lietzke said,
December 22, 2009 @ 10:43 am
Interesting read. There is currently quite a lot of information around this subject around and about on the net and some are most defintely better than others. You have caught the detail here just right which makes for a refreshing change - thanks.
Stefanos said,
December 22, 2009 @ 10:31 am
Can I apply these changes to the .htaccess file in Joomla 1.5 too or this will cause a problem. Which is the best option.
Ruthie Bremer said,
December 22, 2009 @ 9:24 am
Hi found your blog post in Google, its is very informative. Subscribed to your feeds.
islam adel said,
December 21, 2009 @ 6:25 pm
help me how the redirecct handel in php
goddesskarla said,
December 20, 2009 @ 2:06 pm
Thanks for getting to the point and putting clear examples!! Very nicely done! You saved me tons of time..
~gk~
Michael said,
December 16, 2009 @ 12:24 am
Thanks, this really saved my bacon. I selected the mod_rewrite example you gave. This seemed to me to be the simplest to use for my purposes. Many Kudos to you for your help.
affliction clothing uk said,
December 13, 2009 @ 5:15 am
When I try the redirect it comes up saying that the page cant be displayed cos it is stuck in an infinite loop???? please help
Chrissy said,
December 5, 2009 @ 6:00 pm
Crap, I think I did it wrong…
Fred L. Strickland said,
December 3, 2009 @ 3:35 pm
Problem solved. I took the part where you wrote “(the instruction that the page has moved)” as something that I could use. I didn’t realize that this was your comments. The not displaying problem came from a typo on the new web address.
Thank you,
Fred
Fred L. Strickland said,
December 3, 2009 @ 3:19 pm
A Postscript to my previous post. When I uploaded the .htaccess file to my webserver, the result was that my index.html would not display. I had to delete the .htaccess file in order to have my web page to appear.
What am I missing in your instructions?
Thank you,
Fred L. Strickland
Fred L. Strickland said,
December 3, 2009 @ 2:42 pm
Good afternoon,
You have great information, but the web server seems to attempt to read the PDF document before execuring the 301 instructions. The error message is something about the file not starting with %PDF. I dismiss the dialog box and a blank web page appears. The 301 instruction in the .htacces file is not executed at all.
So how do I work around that issue?
Thank you,
Fred L. Strickland
Egnut Seo said,
November 30, 2009 @ 7:43 am
I am moving an html site to wordpress. It has 1000+ pages.. Do I really have to go through each page and add to .htaccess file with a 301 rwedirect?
Free Online Payroll said,
November 29, 2009 @ 9:37 pm
In general I dont make comments on blogs, but I have to say that this post really forced me to do so. Really nice post!
Hangar17 said,
November 26, 2009 @ 2:37 am
hi,
its nice, i have a doubt…how can we direct the google cached pages into new domain pages.
for instance; old page: http://www.xyz.com/service.html
new page: http://www.yzx.com/service.htm
Redirect 301 http://www.xyz.com/service.html http://www.yzx.com/service.htm
is it correct form..do u think that its working?
Dave said,
November 24, 2009 @ 7:30 am
Thanks for the code for redirect using php!
Works great!
Jim said,
November 23, 2009 @ 1:02 pm
Hello.
I have a couple of very simple websites for promoting books written by my client. We plan to discontinue the original site and expand the other.
1) Is there any way to redirect viewers from the old site to the new one?
2) Is there any way to do this when the old site is terminated or would the original domain have to e kept active?
Thanks,
Jim
Paul said,
November 19, 2009 @ 5:05 pm
Thanks Steven,
What is the difference between .htaccess and mod_rewrite (as it pertains to SEO). Is one better to use over the other?
I have a site we are working on (www.ringsidesteakhouse.com) and we moved the site to a new server (same domain name) and want to maintain Google pr rank.
Can I use mod_rewrite to send all pages from old server to the new server?
I did see your mod_rewrite rule for making the “www” and “non-www” apear as one site but didn’t see an example for directing old pages to new server pages. Looking for one global command and not for individual pages.
Regards,
Paul
fishing spots said,
November 16, 2009 @ 5:16 am
If I use the .htaccess redirect will it also redirect my google pr.
Thanks for the Blog, very informative!
asad said,
November 16, 2009 @ 2:06 am
this is really informative i have also need this.describe in impressive.
vijay said,
November 9, 2009 @ 2:53 am
I have One issue, please help me. My issue is I have url http://subdomain.mydomain.com and want to redirect them http://mydomin.com/folder1/index.php?user=subdomain. but I dont want to change URL in addressbar so in addressbar the url should be http://subdomain.mydomain.com. What i have to do? My .htaccess code is
=================================
#RewriteCond %{HTTP_HOST} !^www\.mydomain.com [NC]
#RewriteCond %{HTTP_HOST} ([^.]+)\.mydomain.com [NC]
#RewriteRule ^(.*)$ http://mydomain.com/folder1/index.php?user=%1 [L]
=================================
It redirect correctly, But Unfortunitly, it affect addressbar, so it’s useless for me. Please help me. What I have to do? Thanks in advance.
Danny Maireroa said,
November 2, 2009 @ 4:05 pm
Hi there
I just built my new website http://www.illumetestimony.com, and just learning a little more about 301. So what do I do to my site for a 301?
It is showing duplicate content; http://www.virante.com/seo-tools/duplicate-content.php. How do I solve this one?
Many thanks in advance
CHEERS
Mikolaj said,
October 25, 2009 @ 3:02 am
Hi Steven,
I am hosting http://globenanny.com on GoDaddy.com.
When I use Response.Redirect(”~/Globenanny.aspx”); to redirect to the same page
after I submited my credentials in login I get Generic Error.
When I replace Response.Redirect(”~/GlobeNanny.aspx”) with
Response.Redirect(”aa.com”) I do not get any error.
This Generic Error at first does not occur and I am happy, but after 2-3 hours it shows up. I also asked my friends to test on different computers and at first it works
and after a while when they test the error shows up.
When I host this application on my own computer I never have error like this.
Please help solve the problem.
Thanks, Mikolaj.
Macclain said,
October 21, 2009 @ 8:09 am
How can I do 301 redirect on IIS server for Canonical Links. Whole site is in HTML.
Wesley said,
October 20, 2009 @ 1:03 pm
How does this effect the redirected URL as far as search engine rankings are concerned?
Kathryn said,
October 16, 2009 @ 12:15 pm
Hey,
Is a 301 redirect a good method to use if I want to direct traffic to my organization’s Myspace page while I’m restructuring the site?
Carl said,
October 16, 2009 @ 10:40 am
This was perfect!!! What a web page. So much useful information and code examples!!! I can’t say thanks enough.
Vic said,
October 12, 2009 @ 4:15 pm
Awesome!! Exactly what I was looking for!!!!! Thank you.
Paul said,
October 7, 2009 @ 12:28 pm
Stephen:
We are about to laucnh a .net website. It will replace an old php site. Is it possible to create redirects from e.g. about_us.php to about_us.aspx but within the IIS environment? For SEO purposes the client does not want a generic redirect to the home page but new for old, page to page redirects.
I’d be grateful of any advice you can give.
Thanks
Paul
Des Walsh said,
October 6, 2009 @ 8:58 pm
Hi
I have a .htaccess file inserted by the former host of the site. But google’s webmaster tools is picking up some pages as 404 not found, from an earlier time when the blog was in a /blog subdirectory
Is there some additional or alternative code I can insert?
E.g. should I just identify the not found pages and add in the code as above, for each page,
Redirect 301 /old/old.html http://www.you.com/new.html
I’ve spent a lot of time trying to understand this stuff but still am out of my depth. Any help appreciated
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
inderpreet singh said,
October 6, 2009 @ 9:14 am
can we also redirect one single page to another my blog’s same article page .This can be used in blogger?
Ahoura said,
October 2, 2009 @ 8:30 am
wow amazing!
Mathew Bridle said,
September 30, 2009 @ 5:14 pm
just brilliant, saves wasting two years of search engine links. Many thanks.
Scott said,
September 30, 2009 @ 2:20 pm
If you’re looking for a way to 301 Redirect all pages under IIS to a different domain, I recommend you read the following article which talks about the different wildcards you can use in the redirect URL in IIS.
http://www.mcanerin.com/EN/articles/301-redirect-IIS.asp
I hope this helps!
Linda Hess said,
September 27, 2009 @ 1:46 pm
Stephen:
I have a current site hosted by 1&1 which I do not like (neither the site or the hosting). When looking for an inexpensive web design solution and one that I could be an active participant in, I stumbled upon Wix.com. I love their web building program - I don’t have to be a “teck” , but I can let my design side have a field day. Since Wix is not a hosting service (that is, without the wix address extension) and they retain the site I have built (not published yet), I will need to have my host point my domain to the Wix IP address. So, at long last, my question: Will search engines still be able to find my web? Do I lose anything like web visibility in this process? Thanks, Linda
Ol.a said,
September 25, 2009 @ 6:15 pm
Thank you very much!
I just deleted a page of my site and I used the 301 redirect.
Very easy and absolutely useful!
Thanks!
Daniel said,
September 24, 2009 @ 12:00 pm
I like the .htaccess way of using a redirect, this is very smart, but I do have one question. Is there a way to make the .htaccess wait a few seconds before the browser redirects. I would like to put a message on the old page that lets the user know the page has moved and for them to update their bookmarks and links.
Thanks,
Daniel~
linda is CONFUSED! help said,
September 20, 2009 @ 5:24 pm
HI! I need your help,and do not know how to use the proper term,I have a Portfolio and need to REDIRECT my Domain name to the new Hosted Portfolio. See I have redirected and my old web site is comming up,I have indeed taken all content off,but It is cashed ,How can I change this,I have depression and hate that it shows this! Pleae tell me what to do
ps3 slim said,
September 14, 2009 @ 3:47 am
How do I stop getting 404 errors for pages on the old site that don’t exist on the new site?
xxi said,
September 12, 2009 @ 4:38 pm
Hi,
I try to redirect more pages to a new site but I always get a 500 server error :
Redirect permanent /oldpage.php http://www.newsite/newpage.html …
Il have looked through all forums but i can’t get any answer…
Thanks
Natasha Zabchuk said,
September 10, 2009 @ 11:46 am
@Michael Priest
301 is for a permanent redirect; don’t use it for cancelled classes.
302 and 303 is for a temporary redirect (303 is actually called “See Other”) but you should probably be using 307: (from wikipedia.org (search List of HTTP status codes) “the request should be repeated with another URI, but future requests can still use the original URI. In contrast to 303, the request method should not be changed when reissuing the original request. For instance, a POST request must be repeated using another POST request.”)
It looks like you’re adding it to the .htaccess file, yes? If so, you need to write:
Redirect 307 /stvincentre/index.html http://www.stvincentre.com/cancellation.html
(not ‘temp’)
- Natasha
Michael Priest said,
September 9, 2009 @ 8:44 am
Hi I tried using your redirect code and I keep getting a 500 error. I don’t need it to be redirected permananatley. I just need it to redirect to a class cancellation page when classes have been cancelled. On my web hosts server stvincentre.com is a subdirectory of the root. Here’s the code I used:
Redirect temp /stvincentre/index.html http://www.stvincentre.com/cancellation.html
Thank you for any assistance
Michael Priest
jeyjey said,
September 8, 2009 @ 4:17 am
Thanks for your informative topic
Nnanna said,
September 3, 2009 @ 10:35 am
The Rails method here no longer works…
Here’s the new way to do it:
head :moved_permanently, :location => “http://www.domain.com/”
Look here for more info:
http://zacharypinter.com/2008/07/25/301-redirects-in-rails.html
dontae said,
September 3, 2009 @ 12:55 am
im having a problem with where to place redirect code can you help me out??? thanks i been going at it for weeks now but im stuck…
tyre said,
August 24, 2009 @ 7:10 pm
thx for the pointers and the sample code, i was going to redirect the old way. So glad you have shown me otherwise
Andy said,
August 23, 2009 @ 12:48 pm
Thanks for the lesson. Very Much appreciated!!
CadDog said,
August 16, 2009 @ 12:07 pm
First of all, Thanks for putting together a simple yet clear methods many can follow…
Here is another code I found which looks a lot like your code but
there are a few parts not match and I just want to better understand that I place.
[code]
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yoursite.com [NC]
RewriteRule ^(.*)$ http://www.yoursite.com/1 [L,R=301]
[/code]
—
Your code:…
[code]
deny from all
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.yourwebsite\.com)(:80)? [NC]
RewriteRule ^(.*) http://yourwebsite.com/1 [R=301,L]
order deny,allow
[/code]
Note:
>>> the (:80)?
>>> the missing $ before the http.
>>> the the format of [R=301,L]
I’m they are there for a reason, I just want to understant better why…
Thanks Steve (GREAT SITE…!!!)
and because of it I know more than before…
'Jumaana' Syed Ali said,
August 14, 2009 @ 1:12 pm
Awesome. I just had so much problems in fixing 2 of my website links which was in the other path earlier, which I have sent to many friends & posted in many websites. But now I am able to solve all these issue with this simple 301 method. Great Job Steven. Thanks a lot.
swinger said,
August 13, 2009 @ 8:10 am
really, a great information about redirection and i find this too useful ..thanks
mac said,
August 11, 2009 @ 7:11 am
My example code is missing from my last post…
Is there some way to show it on this page ?
mac said,
August 11, 2009 @ 7:04 am
Hi, Steven…
I’m a little confused about the best way to proceed.
Task: So that I can more easily automate my website…
I’m thinking of converting ALL of my current websites .htm pages, to ALL .php pages.
Some of my webs current .htm pages appear in a google search, (if I search for the relevant info on those pages)…
…Now I don’t want to loose those google results, so currently, I’m just using the original .htm page to divert to the new .php page, (so is that ok ?) ie:
By replacing the content of the original .htm page, with the following ‘Refresh’ code…
example code:——–
page loading….
If it doesn’t load in 5 seconds ~ click here
———————
So, what is the best way to switch all off my websites .htm pages, over to .php pages, without affecting the current google results, or future results ?
Should I use ‘301 Redirect Using htaccess’ ?
If so, wouldn’t I have to add a line of code (to the htaccess file) for EVERY-PAGE in my website ?
ie, example code:————–
Redirect 301 /old/htm_page_1.htm http://www.mywebsite.com/php_page_1.php
Redirect 301 /old/htm_page_2.htm http://www.mywebsite.com/php_page_2.php
Redirect 301 /old/htm_page_3.htm http://www.mywebsite.com/php_page_3.php
etc,
etc,
etc,
etc,.
——————————
Or should I use: 301 Redirect Using PHP ?
If so what does that involve ?
Sorry, but I don’t really understand your ‘example’ code, ie:
Your example code:———
—————————-
Hope you can help, many thanks.
B George said,
August 6, 2009 @ 8:41 am
Hi,
I’m using a tool to crawl my web pages. And the tool says I’ve duplicate pages. The duplicates are below:
1. http://www.lenvica.in/
2. http://www.lenvica.in/index.php
Is it necessary and possible to redirect (1) to (2)?
Thanks,
Biju.
April said,
August 3, 2009 @ 12:50 pm
You are awesome
Duncan said,
August 3, 2009 @ 3:00 am
Hi Steve,
I have exactly the same problem with Ivan. Could you please tell us how we can fix it?
Thanks
jon said,
July 23, 2009 @ 4:35 pm
What should the permissions be set to on the .htaccess file, since it’s on the root?
thanks!
N74JW said,
July 13, 2009 @ 9:52 pm
PHP method doesn’t work…
“Warning: Cannot modify header information ” is the resultant error message.
randy said,
July 11, 2009 @ 1:54 am
hi steven,
i am developing a web form in asp for login .
i want to use redirect method howeever, if login successful i want the page wait for 3 sec and then redirect to given page.
please help me
thanks
Chani said,
July 8, 2009 @ 11:55 pm
Thanks so very much for sharing your insights on this topic. Saved me hours of tedious work removing my old website, plus I learned something new about SEOs.
Rob said,
July 8, 2009 @ 1:33 pm
Here’s a tough one. Say you have an old web site with 1,982 links. That whole site needs to be redirected, wholesale, to the newly designed site except for, maybe, 20 select links. Those 20 select links need to still be available at the old URL until some future date when they can be fully redirected.
What the heck can I do, if anything?
Ivan | Jobs Blog said,
July 7, 2009 @ 2:55 pm
How about when I have external pages linking to the .html page on my site - and that page is renamed?
I have sites linking to the mysite.com/about.html
and that page is renamed to the about-us.html?
What do I use (on a Windows IIS server to implement the 301 redirection please?
Thanks,
Ivan
Steven Hargrove said,
July 5, 2009 @ 6:38 pm
@Chad:
What data are you basing your analogy from? Since when is .html necessarily better than .php?
The only time .php or any server-side language file extension is potentially less-helpful for SEO - is when you are using query string parameters (ie: file.php?var=value&var2=value2″…etc)
This is a good example of SEO paranoia. In fact, if anything - changing the page to .html from .php will do nothing at this point but actually negatively impact your SERPS until search engines have fully crawled the said html pages.
My advice? Don’t make SEO decisions based off assumptions.
Chad said,
July 3, 2009 @ 12:31 am
For SEO reasons, I’d like to change one of my sites from .php file extension to .html
I know the proper way for rankings purpose is to use a 301 redirect in htaccess file. However, I’m not 100% sure how to do this without affecting certain folders (such as blog, forum, billing software). They must be untouched and continue using their own .php files.
Can someone explain how I can work around this and provide a sample 301 line to achieve this?
Are 301 redirects bad for SEO in the long run?
Thanks
Rob said,
July 1, 2009 @ 6:23 pm
Thank you Steve. Easy to follow, worked first time for me.
Andy said,
June 29, 2009 @ 8:35 am
was gonna add flash intro but the one i have after playing wants to go to a html page whereas i need it to go to index.php.(instructions said rename index.html to main.html and it will work but i only have index.php),so how to redirect after playing…plz help
Peter said,
June 26, 2009 @ 5:34 am
I’ve used 301 in .htaccess but it works for one page but I cannot get it working for more than one. What is the code for multiple pages?
Chris said,
June 25, 2009 @ 11:06 am
Thank you for this. Helped me out a lot. I like that you list 301’s in each language.
Steven Hargrove said,
June 23, 2009 @ 12:55 pm
@mystery_o9
That bit of code does not generate a “301 Moved Permanently” status code. I believe it uses the 302.
davedds said,
June 23, 2009 @ 3:02 am
I tried every script on here just won’t do it please advise
Знакомства said,
June 23, 2009 @ 12:19 am
Я считаю, что Вы не правы. Предлагаю это обсудить. Пишите мне в PM.
mystery_o9 said,
June 22, 2009 @ 4:31 am
i have got a more simple way for asp.net users (ver. 2.0) :- Just use the Response.Redirect() method.
// sample code
// your class code
// your function handling Redirection() {
Response.Redirect(”url to which you want to redirect”);
// }
Year One Online said,
June 20, 2009 @ 3:48 pm
After reading the article, I just feel that I need more information on the topic. Can you share some more resources please?
p.s. Year One is already on the Internet and you can watch it for free.
Fabien said,
June 19, 2009 @ 4:57 am
Saddly, it doesn’t work for me. I set up a php page, pasted the php code in the body. But with no results. I am trying to set a redirection page from facebook, in order to count accurately the number of visits and visitors behavior from our facebook ads. Any tips?
Thanks in advanced,
Besplatna Muzika said,
June 18, 2009 @ 10:22 am
Very valuable page. Worked the first time. Thank you! Samo najbolja besplatna muzika
Erotika said,
June 18, 2009 @ 10:21 am
Very valuable page. Worked the first time. Thank you!
Erotika said,
June 18, 2009 @ 10:20 am
thanks!!!!
it works!
Mark said,
June 16, 2009 @ 7:14 pm
Very valuable page. Worked the first time. Thank you!
barbara said,
June 10, 2009 @ 10:48 am
thanks!!!!
it works!
Tony Cook said,
June 4, 2009 @ 5:02 am
I need to setup automatic redirection to a ’server down for maintenance’ web page hosted on another server when I take down a production server. What is the best way of doing this - am I looking in the right place ie DNS redirection. We host our own DNS and webservers so access is not a problem. Thanks in advance.
David Zielinski said,
June 3, 2009 @ 7:50 am
Just a note / thought, many people might not have access to the hosting environment for their webserver. So obviously accessing the .htacess file or IIS might be a little difficult.
If the page is a plain .html file (already indexed), could you meta refresh / javascript redirect to a .asp file (also located on the same website / domain). Then this .asp page could use 301 redirect to the updated new website / new domain.
The sort of scenario I am talking about is when a company changes names, and thus has a new domain name and website, the old site needs their pages redirected to the new site.
Ronald Thompson said,
June 2, 2009 @ 9:04 pm
I think this is a good web page here. I found out that I can only display my web page when I type first http://www.google.com and then my retype http://portable-notebook.20m.com. Is there a way to type both in one line?
Thanks,
Ronald Thompson
rosie said,
May 26, 2009 @ 3:33 pm
Ok,total novice here. Excellent article I will re-re-re-re-read. My question is can I trust using the redirect feature found in some hosts? Is that considered a 301 redirect?
tamara said,
May 25, 2009 @ 9:46 pm
I was wondering if you knew how to cancel a redirect. I am trying to access the UK site of a company through its .co.uk url, but it keeps on redirecting me to the .com.au here in australia.
Do you know any tricks to get around this?
Liam said,
May 22, 2009 @ 9:59 am
Hi there, I am using IIS, and need to redirect 100+ pages, I dont really want to have to enter each one indivudually as shown here…is there a way to create an htcaccess type file for IIS?
Thanks
web page Design company said,
May 21, 2009 @ 3:06 am
thank you for providing all development code of redirect page.
kristianne earnhardt said,
May 19, 2009 @ 6:58 pm
How can I redirect this site http://kristianneearnhardt.com/
I’ve tryed my self but I can’t seem to do it. This is a old site that I’m no longer part of. I’m with Century 21 not Exit.
I would like it to go to
http://www.homepages.com/KristianneEarnhardt140/AgentHome.aspx
Can you help me?
Larry W. said,
May 18, 2009 @ 12:35 pm
Do you outsource your graphic work for your website? I like them and would be interested in knowing who did yours!
Gaurav Sharma said,
May 18, 2009 @ 3:14 am
In MSN my webmaster is showing some URL with extension .html but as i have created my new site in Sharepoint please tell me where should i use the redirecting code of ASP in HTML Pages or shall i use in Sharepoint code.
Faisal said,
May 12, 2009 @ 10:08 am
Hi All,
I’ve question for redirecting it is possibe if someone redirect the page in HTML from OLD page to new Page but the address is showing old address but page is redirected. for example http://www.xyz.com redirect to http://www.abc.com but on the address bar it is showing http://www.xyz.com
Thanks waiting for your reply
Faisal
Tammy said,
May 8, 2009 @ 12:25 am
I am probably far newer at this than anyone here so please be patient with me. I want to use the 301 Redirect Using htaccess to redirect from my old URL to my new URL. I’m sure it seems rather simple but I’m not exactly sure what to fill in and where in order for it to work. My old address is http://tlawson521.googlepages.com and my new url is http:www.carriagehousecockersandcockapoos.com . Thanks so much for your help!
Si buJaNG said,
May 6, 2009 @ 7:52 pm
Thank’s for share your info
Mark said,
May 6, 2009 @ 2:25 pm
Thank you for being so damn smart! Best regards.
Serviced Apartment Bangkok said,
May 5, 2009 @ 5:58 am
Blogs like this are why I use the internet.
Serviced Apartment Bangkok said,
May 5, 2009 @ 5:54 am
Thanks very much for your blog. Will eb back!
Louisa said,
April 30, 2009 @ 3:23 pm
I’m still unsure what I am doing wrong. When you say the top do you mean the first line or in the header? The weird thing about the file I am working with (and mind you this is my first foray into ASP) is that it looks like HTML in every way except that the file extension is ASP. Is there a way you can look at the source of the pages and help me figure out what I’m doing wrong. I’m really not sure where to turn for help, so any help you can give is much appreciated. Also, the site is hosted at Godaddy just in case this is of some importance. They also gave me the exact same directions that you did, and not surprisingly they didn’t work.
Any thoughts?
Steven Hargrove said,
April 30, 2009 @ 2:54 pm
@Louisa - It should go at the top of your ASP page.
Louisa said,
April 30, 2009 @ 8:53 am
Whoops…I meant to say I was trying to redirect http://www.sail-newport.com/contact.asp to http://www.sail-newport.com/html/contact.html
Louisa said,
April 30, 2009 @ 8:45 am
Your information is better explained than most sites out there, but alas I am still having trouble. I am trying to reroute our current asp website to a new html website on the same domain. I have been trying to use the asp redirect as above but I am obviously doing something wrong because it wont seem to work. When I try to redirect http://www.sail-newport.com/index.asp to http://www.sail-newport.com/html/index.html I just get a blank screen.
I have a feeling I am not either typing something in wrong (although I’ve tried and rechecked several times and end up with the same result) or I am trying to use the wrong type of redirect. Where exactly in my asp file is this supposed to go? I am unfamiliar with asp, and pretty new to web design in general, so more specific directions about exactly where this is supposed to go within the file would be really helpful.
Thanks in advance for any help you can provide!
Ankur said,
April 29, 2009 @ 2:54 am
Hi
Thanks for this info, my requirement is to redirect to a url which is dinamically generated while trying to access the original url, so is it possible to fetch the newly generated url from the exception thrown by axis2 .
ALC said,
April 28, 2009 @ 7:54 pm
Thanks…great article
ALC said,
April 28, 2009 @ 7:05 pm
Wow! Thanks for the ASP version…After hours….of trying to get IIS and htaccess working…I finally found this and it worked.
thanks again….
ALC
Ashraf Farrah said,
April 24, 2009 @ 6:49 am
Thank you very much … the PHP worked for me in Internet Explorer, I simply copy-paste the plain code into notepad and named it as index.php then uploaded to my website home folder.
Evisc said,
April 20, 2009 @ 7:01 am
Wow amazing how many ways it can be done. All of which works for me in Firefox, but none on IE7. Any idea why though?
Khalid said,
April 18, 2009 @ 10:10 am
Thats’s great tips, thanks a lot.
Frank said,
April 15, 2009 @ 3:59 pm
Hi Steve,
Great article with alot of useful information. I have a site written in PHP and my PHP page calls use alot of arguments, these arguments need to also be transferred to the new redirect web page.
Is this possible using the 301 .htaccess redirect method or do I need to rewrite the PHP pages to do this?
Thanks for the great info.
Frank
ag0g0girl said,
April 5, 2009 @ 8:47 pm
This is fantastic. I tried 4 different ways to type the redirect, but yours is the only one that works for me.
Evans said,
April 4, 2009 @ 8:52 am
Thanks for this tip - I was looking of solving my redirect problem with Google bot.
This has all that one could ask for.
Nice blog btw
Garden Mad said,
March 24, 2009 @ 4:32 pm
I would like to add this redirect to my site but the site owners won’t let me enter any code in the header. Does this mean that I cannot have any redirects?
claire stokoe said,
March 22, 2009 @ 12:53 pm
Great article, i have linked through to each of the code sections to help our readers carry out any redirects. Once again, great article and thanks for the detailed information.
claire
Peter said,
March 20, 2009 @ 6:40 pm
Excellent article on the 301 Redirect. I probably would’ve done it the old way if I hadn’t stumbled upon your website. Thanks.
klaus said,
March 18, 2009 @ 11:39 am
Hi Steve,
thanks for the great article about redirection, got me out of the ditch, and it works!
aisha said,
March 13, 2009 @ 3:00 pm
Thank you for the help
Julian said,
March 11, 2009 @ 10:26 am
Hi there,
I want to redirect a cfm page back to the root directory but have been told this is virtual page and it cannot be done - can you point me in the right direction regarding this?
Cheers.
Jules.
Nathan said,
March 10, 2009 @ 12:08 am
I’m trying to redirect with keyword
ie.
order.php?ipa=11
I want to redirect only #11 to a certain site
and then redirect order.php?ipa=12 to another site
but then any other number to function on the website as normal
can you help? Email me and I will give you more details
Ani said,
March 6, 2009 @ 12:45 pm
The whole article is nicely structured easy to understand. Thanks for sharing
james said,
March 5, 2009 @ 9:50 pm
Hi there, I was wondering whether you could use the .htaccess file on an windows/IIS server, as I have several pages I would like to 301 redirect to a new site, and the page names are not the same so using a regular 301 redirect within IIS is not possible.
Please advise. Many thanks!!
louie said,
March 5, 2009 @ 12:41 am
thank you
Ken Jasper said,
March 4, 2009 @ 6:23 pm
I’d love to use the htaccess method, but my old filename has a space in it, and my IIS doesn’t allow filenames with spaces. Therefore, I’m trying to use any other method. Nothing seems to work for me, but I’m pretty much a newb at this. I pasted your ASP code (without the list numbers) into my old page (the one I’m redirecting from) and replaced the “http://www.new-url.com” with my “http://www.mydomain.com/mynewpage.html/” and it simply ignores it. What am I doing wrong?
Greg Turner said,
March 2, 2009 @ 7:24 pm
Thanks. I used the php method and it works just fine. In the page being redirected I put a message to the user that they are being redirected with the url of the new page, but that message does not display - the redirect happens really fast. I would like the user to know what is happening. Anyway to address this problem?
nichive said,
March 2, 2009 @ 12:22 pm
I had a problem with my permalink before, but your single redirect tips solved the issue, thanks alot.
unique said,
February 28, 2009 @ 8:39 pm
Normally I don’t leave a comment but your post was excellent, well written and informative.
Steven Hargrove said,
February 27, 2009 @ 11:36 am
@Steven Ruffolo
the name of the file is just .htaccess - that’s all nothing more.
Steven Ruffolo said,
February 26, 2009 @ 1:19 pm
Mr. Hargrove, I have created a “.htaccess.txt” file and this is what I have in it, your instructions are above and the line below is my replacement. Does lthis look right? Would my next step be to put the .htaccess file into the /public/ folder? Also what extension should I give it, should it be .htaccess.html?
redirect 301 (the instruction that the page has moved)
redirect 301 The BOTTOMLINE WEBSITE HAS MOVED
/old/old.html (the original folder path and file name)
/public/index.html
http://www.you.com/new.html (new path and file name)
http://mbl.fmdatabase.com/fmi/iwp/cgi?-db=mbl&-loadframes
Steven Hargrove said,
February 26, 2009 @ 10:43 am
@Steven Ruffolo
I would urge you against redirecting in flash, you should use a 301 redirect. Which is really something I try to communicate in this article.
Steven Ruffolo said,
February 25, 2009 @ 8:40 pm
Mr. Hargrove,
First off let me say I am not a web designer, I have worked on main frames all my life, but a friend asked me to fix his website, it was created using flash. I took it over but now he has had someone build a new website and I have to redirect it using commands in Flash, would you be able to direct me to the section that could walk me through it.
Thanks in advance
Steven Ruffolo
Matthew Anderson said,
February 22, 2009 @ 7:15 am
Do 301 redirects work well for subdomains and setting geo data in googles webmaster tools? I have recently added a country specific subdomain to my site and am having a hell of a time with my rankings. Initially we have 302 redirects whcih we chasnged to 301 but the problem remains that the geo target just does not seem to be working. I suppose my questions is: Can a badly configured subdomain affect the functionality of the geo target?
Steven Hargrove said,
February 22, 2009 @ 12:27 am
@Larry Wasson
Well,, back them up and yes, deleting them is probably a good idea. Although since the htaccess will be bypassing them anyway, I’m not certain that it will make any difference.
Larry Wasson said,
February 21, 2009 @ 1:37 pm
Just completed a .htaccess for about twenty pages and seems to be operating correctly. Should I delete all the old files being redirected on the server immediately?
Steven Hargrove said,
February 19, 2009 @ 11:08 am
@TG
I updated this article to talk a little bit about canonical links in context to redirects. Here’s the anchor link to that: http://www.stevenhargrove.com/redirect-web-pages/#canonicallinks
TG said,
February 19, 2009 @ 12:33 am
The post has a thorough explanation of 301 redirect.. Can you give more ideas how it is different from the new Canonical url tag?
Nick said,
February 17, 2009 @ 2:12 am
@ken
Check to make sure you do not have any blank lines (or echo statements, etc) above your “<?” statement. It looks like on line 10 you have something being printed to the page, which is not allowed if you are going to later set the headers (which you do on line 16).
If you provide the entire code you have in index.php that will help.
Adam said,
February 16, 2009 @ 5:14 pm
Thanks, php code word perfectly for me.
ken said,
February 15, 2009 @ 12:06 pm
I tried to use the php redirect code but get the following error below, note I have used this code on a midphase hosting account and it works fine, but this is the 1st time I have tried it on a Hostgator account
——————————–
Warning: Cannot modify header information - headers already sent by (output started at /home/fishing1/public_html/lures-ebook/index.php:10) in /home/fishing1/public_html/lures-ebook/index.php on line 14
Warning: Cannot modify header information - headers already sent by (output started at /home/fishing1/public_html/lures-ebook/index.php:10) in /home/fishing1/public_html/lures-ebook/index.php on line 15
Warning: Cannot modify header information - headers already sent by (output started at /home/fishing1/public_html/lures-ebook/index.php:10) in /home/fishing1/public_html/lures-ebook/index.php on line 16
———————————————-
this all the code on my page which I named index.php
Make Fish Lures
servlet said,
February 11, 2009 @ 5:35 am
Thanks for the tutorial, I was looking for the solution for JSP, and I got it here
http://www.jsptube.com/examples/response-sendredirect-servlet.html
Ankush said,
February 9, 2009 @ 8:34 am
Great tip, thanks!
Lee said,
February 4, 2009 @ 3:59 pm
I was wondering if google’s webmaster tools for setting the preferred domain to http://www.somesite.com vs somesite.com takes care of the page rank division you mentioned under mod_rewrite. Or is it just simpler to just specify the mod_rewrite & be done with it?
Kate said,
February 4, 2009 @ 11:21 am
Thanks for these instructions. They were immensely helpful, as I have very little coding experience. At the risk of sounding like a huge nerd, I have to tell you that accomplishing this redirect kind of made my day. And I maybe did a victory dance that scared my dog.
Thanks!
Beth said,
February 2, 2009 @ 6:01 pm
Hi,
Will using the “301 Redirect Using htaccess” require a restart of the httpd service? My server is an HP-Unix 11.11 and it is running NCSA httpd 1.3 (sorry, upgrading to Apache is not a viable option).
Craig said,
January 31, 2009 @ 2:09 pm
Steven,
Thanks for the tips. After implementing 301 redirects between web pages on the same site, should we delete the old page so there aren’t duplicate content issues?
Thanks,
Craig
Daedalus Howell said,
January 29, 2009 @ 2:36 am
Steven – Much thanks to you for providing such lucid and valuable information. I just activated the 301 redirect and am very pleased with the results. With gratitude, DH
John said,
January 27, 2009 @ 3:55 pm
I am really struggling with this. My site is all HTML. My host is streamline.net running Windows server 2003 with ASP, whom I have asked for help or advice and they tell me to check the internet. Some support that is !!
Yes I wish to use a ‘301 redirect’ to send my pages from “merlinmounts.co.uk/pages.htm” to “www.merlinmounts.co.uk/pages.htm”
I have tried the .htaccess in both root and in the htdocs folders with the code given above. To no avail. Then I was told that .htaccess will not work with Windows Web host.
So I am really confused as to how to do this. Can anybody please help with either suggestions or links - and I think I have read most of them.
Thank you in anticipation
Chris S said,
January 19, 2009 @ 12:56 pm
Hiya,
I have a customer who has paid for this entire site which is in ASP.
They use an off the shelf e-commerce packages which creates html pages. They have created the same pages in this package using the same page names appart from having .html instead of .asp at the end.
Is there a generic redirect they can use for all *.asp pages to go to the *.html page instead?
Thanks for any time you have in helping.
BR
Chris.
Ephy said,
January 15, 2009 @ 7:38 pm
Hi,
i have to redirect a asp page from http://www.mydomain.com/1.asp?ID=XX
to http://www.mydomain.com/1.asp.
the case is that in this page there is a link like following:
click here
so my question is how to redirect page without the query string but to have it anyway
(sorry if I’m not very clear…)
thanks 4 your help
Ephy
Eric said,
January 13, 2009 @ 2:34 pm
How can I keep the redirect pages url: http://www.mysite.com/123.php in the browser after the destination page is loaded?
SS said,
January 11, 2009 @ 12:43 am
Thanks alot! Your suggestion works for me! now i can direct mydomain.com to http://www.mydomain.com as I wish using htaccess code.
Thanks again!
SS
Jamp Mark said,
January 7, 2009 @ 3:50 am
hi, i have a scenario.
if siteA randomly redirects to siteB using 301 to effectively share traffic,
will PR of siteA transfer to siteB or both will have same PR?
thanks
Chris Mahan said,
December 30, 2008 @ 11:18 pm
Excellent!
friend said,
December 30, 2008 @ 10:11 am
“refresh” meta command
Note that this method is deprecated by the official HTML standards organization in favor of the server-based redirect method described above.
You can set up a web page to inform any browser which happens to load it that there is another web page it should go to instead, after an optional delay.
This is accomplished using a “refresh” meta command in the header section
.
.
of your HTML file, along with the title and any “keywords” or other meta commands.
Syntax
The syntax for the “refresh” meta command is
where N is the approximate number of seconds that you want the current web page to be displayed before the browser automatically goes to the other web address. If N = 0, then the browser should go immediately to the other web address.
Netiquette tip
In case someone’s browser doesn’t handle these automatic redirects (most browsers do handle them, but some allow them to be turned off, as a way of discouraging “web spam”, which often uses this type of “refresh” redirect), you may want to provide a second route to the intended destination by way of a standard link (see the example, below).
Example
A web page that points a browser to a different page after 2 seconds
If your browser doesn’t automatically go there within a few seconds,
you may want to go to
the destination
manually.
Billigflüge said,
December 30, 2008 @ 4:33 am
Thank u for taking the time to write this article which is very helpful to me
” you can manually choose the domain page by going to googles webmaster page and chose the settings tab”
I have tried it , it works
keep up the good work
I will be aregular reader of ur blog
Dave said,
December 28, 2008 @ 7:55 pm
Hi Brandon
Hey guess what i found out : Did you know that you can manually choose the domain page by going to googles webmaster page and chose the settings tab.
PennySeeds.com said,
December 24, 2008 @ 10:06 am
Thanks a lot for this information! I was having a problem with my indexing, because of an ‘http’ and ‘http://www’ version of my site. Now it’s set to 301 re-direct to one of those, and I think this should fix my problem! : )
Thank you!
JEB said,
December 23, 2008 @ 2:31 pm
Hello Steve,
Great info! Very helpful! I hope you don’t mind me asking if you’d give me some further explaination of this subject, and my apologies if my I get a little long winded. I just want to be certain I’m explaining my issue thoroughly so you understand what I’d like to do and let me know if I’m on the right track… The short version is that I don’t quite fully understand the relationship of the (single) htaccess file, and how it can be use for multiple webpages (assuming you can - as your article refers to directing old pages to new pages).
I found you information, well, searching for a way to redirect ‘A’ web page. Originally only to direct my index.htm page to my home.htm page, but after reading your articles, and if I understand the importance correctly, I’d like set it up for other old webpages to their new webpages…
Let me state right off the bat that I’m not a professional site designer. I have my own personal site that I created and rebuilt several times over the last ten years (and I’ve done a little on the fly coding when I needed it - learning along the way). Now I’ve taken on creating a new site for a friends small business. So after reading your articles, although I understand the concept behind and the differences between the two types of redirects, where the server side redirect is concerned I don’t understanding how I can use the htaccess file for more than one page (unless I’m mistaken and you can’t).
Here’s my issue… As I stated, I’m creating a new website for a friends small business. I’m using the same domain, just updating and adding pages. He wanted to see the new pages on the fly, so I put them into a sub-directory to keep the separate from and to keep the old pages intact until I’m finished. I planned to keep them in the sub-directory, so now I’m looking for a way to redirect the default (index.htm) page in the main directory to the main (home.htm) page in the new sub-directory so I didn’t have two of the same pages with different names - which I didn’t think was the right way to set it up. On the old site it wasn’t an issue, because he used the index.htm page as an individual (portal) page, but he doesn’t want the portal page on the new site - he wants the customer getting directly to his home page.
So initially, I want my index.htm page to “redirect” to the home.htm page in the sub-directory. But now after reading your article, in order to keep his ranking in the search engines, I think I should setup redirects for all the ‘old-name’ pages to the ‘new-name’ pages.
OK, finally getting to my question… So how do I setup redirects for all these pages with a single htaccess file? Do I include an individual line in the htaccess file for each page I want redirected? Or can the htaccess file only be used for ONE page (IE the main/index page)?
This all may be moot for me, ’cause I don’t know if the site hosting server allows for this or not (I’m assuming the htaccess file is something the host needs to be setup for, and his site is setup on one of the free hosting sites - so they may not allow it), but I’d like to fully understand the capabilities of the htaccess file to use later even if I can’t on this project.
Your comments would be appreciated. Keep up the great work!
Happy Holidays…JEB
mike said,
December 21, 2008 @ 4:06 pm
If i create a .htaccess file just with one line “redirect…”, will this pose any security threats?
I am using godaddy shared hosting linux. Just opened it up.
Thanks,
Mike
flafson said,
December 21, 2008 @ 9:35 am
I tried to use the .htaccess method and at best i was getting a loop to myself.
I’m using Godaddy as a host and as a host for my 2 domains, and I’m trying to redirect the .COM domain to a .CA one, all of those are and will be using the exact same root files on the host.
This is the code i tried to use “redirect 301 / http://www.lilianalaser.ca/index.html“
Bruce Achterberg said,
December 21, 2008 @ 7:11 am
Hi Steven,
I have a Wordpress blog. I can do 301 redirects using a .htaccess file just fine, but I’m not sure how to use the same method to redirect urls such as this:
http://www.mysite.com/blogpost#linkwithinblogpost
Unless I remove the “#linkwithinblogpost”, they simply link to the page instead of the redirect.
Which one of the above solutions would allow me to do this? If none of them, any ideas for how I could do this?
Simplicity is preferred, but perhaps I have to pay the price of complexity.
I’d appreciate any advice you can give.
Thanks,
– Bruce
Daniel Massicotte said,
December 20, 2008 @ 8:24 pm
Wow, that was easier than I thought it would be! Thanks!
Dave said,
December 19, 2008 @ 5:52 am
I have a problem google has given my domain name a pr3 but has given my index page a pr5, I thought the index page and the domain name were the same?
For example http://www.speakenglish.com pr3
http://speakenglish.biz/index.html pr5
How do i correct this problem
David said,
December 16, 2008 @ 4:19 am
Man did I go through a minute of total confusion on that learning curve… Thanks! It works perfectly! I not only added in the permanent 301 redirect to my .htaccess but using the http://www.htaccesseditor.com/en.shtml#a_redirect page I also changed my “index.html” to a more search engine powerful key-phrase-in-document.html page as well !! Awesome help here. I love learning new things and re-learning things I’d forgotten. You’re definitely a bookmark!
zzb said,
December 12, 2008 @ 12:38 pm
Many thanks for the tips!!!
Harry McDuffee said,
December 11, 2008 @ 2:30 pm
I would like people to see the following website http://www.shopgbg.com/biz/hhm when they go to http://www.claimyoursnow.com How do I do this?
Debbie Thompson said,
December 8, 2008 @ 7:50 pm
Maybe this is a dumb question, but…
In order to use, for example, the php 301 redirect, the original page has to be a php page (because that is what folks would have bookmarked). Right?
I REALLY want to use the .htacess redirect, but I am very afraid to put an .htacess file on my website - since it is a hidden file, I am afraid I will overwrite a file that is really there already and I just can’t see it. I tested this by putting a .temp file on my server and can see that. So does that mean I really can see the hidden files and should see an .htacess file if it is there?
Will said,
December 3, 2008 @ 11:39 pm
Thanks I used the code on a couple sites!
ejfried said,
November 25, 2008 @ 10:54 pm
Note that the Perl example will do a 302 (moved temporarily,) not a 301 (moved permanently.) To do a 301, you have to specify that explicitly:
$q = new CGI;
print $q->redirect(”http://www.new-url.com/”, -status=>301);
JElena Glumac Adzic said,
November 25, 2008 @ 11:07 am
Thank you for explaining the .htaccess in plain words - this is a sign of a true expert!
Jamie said,
November 21, 2008 @ 4:54 pm
Thank you so much for the information. The code took a little bit of adjusting due to both pages being on the same domain and in the same directory but after a few tries it seems to work great. Thanks again.
Abhishek said,
November 15, 2008 @ 10:56 am
Hi,
Thanks very much for this code. It really helped a lot.
It saved current ranking of my website, which is de-functioned somehow.
Thanks.
Abhishek
Vin said,
November 15, 2008 @ 7:13 am
Hi,
Blogger uses CNAME records in DNS to do a 301 redirect from a blog on blogspot.com to a Custom Domain (www.example.com).
However example.com is redirected to http://www.example.com with a ”302 Moved Temporarily”.
Any comments?
Carol said,
November 14, 2008 @ 9:07 pm
This is the code I put in my .htaccess but it doesnt seem to work. What is worng with it? It is two pages and I put in quotes but there are no qoutes in my file.
“Redirect 301 /old/http://www.completeskincaretherapy.com/salesletter.htm http://www.you.com/new.html
Redirect 301 /old/permanent http://www.completeskincaretherapy.com/skintags.htm http://www.completeskincaretherapy.com/skintagrecipe.html“
Lil said,
November 8, 2008 @ 10:51 pm
This is brilliant - makes it so much clearer than any other site!
Thank you so much!
http://www.igloorpo.com
Amit said,
November 8, 2008 @ 7:53 am
can we redirect .aspx pages by using .htaccess file.
Can you explain….!
Thanks..
Darren said,
November 7, 2008 @ 8:53 am
Thanks for this - just what I was looking for!
abz said,
November 7, 2008 @ 6:03 am
This page about how to create and manipulate .htaccess is brilliant!!
I managed to force people linking or visiting http://internetexplorer-firefox.com to go straight to http://www.internetexplorer-firefox.com which I think looks much better and I know I want lose any PR points.
Thanks
Mark said,
November 5, 2008 @ 8:07 pm
@Miss Gourmandise
if your using mediawiki the code to redirect a page is:
#REDIRECT [[INSERT PAGE NAME HERE]]
Miss Gourmandise said,
November 5, 2008 @ 8:22 am
Hi
I have tried to redirect a wiki page to a web page but found no solution, do you please have any guess? thanks!!
Mike said,
November 4, 2008 @ 8:30 pm
Hi, I’m working on a website designed by someone else. I believe the correct 301 redirect is the ASP one. However, I’m putting the code on the page, but the page isn’t redirecting to the new site. The webpage I’m trying to work on is:
http://spaceodysseyusa.com/Default2.asp?Page=69
Here is a snippet of the code:
Hello
DELILEK ONLINE said,
November 1, 2008 @ 12:21 am
Great article, I just tried it, it with PHP, it did work.
Thank you
Internet Marketing Agency said,
October 29, 2008 @ 3:03 am
Nice summary Steve!
The more people that start doing this with their sites the better! That reminds me, I have a few pages to clean up as well!
Digimode said,
October 25, 2008 @ 11:17 am
I tried on few sites. Works like a dream! Cheers’ again!
katrina said,
October 20, 2008 @ 8:12 pm
Well - took some adjusting because I didn’t read your simple directions thoroughly (duh me!) but once I re-read your directions, worked like a charm, and exactly how I wanted it to…thanks SO MUCH! Katrina
Lamba said,
October 17, 2008 @ 8:12 pm
Great article! Covers all the possible angles. Cheerio!
CAP Digisoft Solutions said,
October 17, 2008 @ 12:28 am
Hi,
I have tried with aspx 301 redirection code to my site. but it was working.
is there anything we need to change before applying that code in to particular page?
Umar said,
October 13, 2008 @ 6:01 pm
The article rocks! Thumbs up
Nika said,
October 12, 2008 @ 4:50 am
Thank you! The 301 redirect works perfect!
Al3loo said,
October 9, 2008 @ 11:40 pm
I want to redirect my news path from:
/([0-9]{4})/([0-9]{2})/([0-9]{2})/news_([0-9]+).html
to be like this:
/news_([0-9]+).html
I tried this:
Redirect 301 /([0-9]{4})/([0-9]{2})/([0-9]{2})/news_([0-9]+).html http://www.domain.com/news_([0-9]+).html
But it’s not work .. any idea ?
and thank you very much for this nice topic .^-^.
werutzb said,
October 7, 2008 @ 11:28 pm
Hi!
I would like improve my SQL knowledge.
I red so many SQL resources and want to
read more about SQL for my position as oracle database manager.
What would you recommend?
Thanks,
Werutz
steave said,
October 3, 2008 @ 9:41 am
Thanks to this site. now i understantd 301 redirect.
Danny said,
October 3, 2008 @ 3:07 am
Hi, i got trashed by buying http://sexguru.us
It is a fake PR site.. But I have linked it with my blog now. Still it gets redirected when using cache:sexguru.us on google. Any idea why it is happening? Please help
David said,
October 2, 2008 @ 3:10 pm
Hi there,
We are working on some conical issues for a client. We were told that we need to ensure Google is seeing every page as “www” versus “non-www”. I have been looking into all sorts of 301 stuff, but I need some advice. I cannot find the best solution. I do not have access to the htaccess. I was planning on changing all file extensions to .aspx and doing something with a script. Am I on the right track? I need to have this nailed since the client does a LOT of his revenue online. Thank you for any help.
Dave Tierney said,
October 1, 2008 @ 3:12 pm
i have my current site on a linux server that i don’t control the root for. http://ww2.allina.com/anwim/residency/index.html
I have access up to the /anwim/ folder, but not above. i am trying to redirect everything in the /anwim/residency/ subfolder to my new site index page http://www.anwresidency.com.
is there a way to do a 301 without being able to put a .htaccess file in the root that i don’t have access to?
Tadinee said,
October 1, 2008 @ 12:20 pm
I just added the 301 redirect script for ASP.Net on the page on the head tag but I when I upload the page I got an error. Please help what did I do wrong?
Below is the error,
————————————————————
ERROR INFORMATION
————————————————————
ASPCode: ASP 0124
Number: -2147467259
Source:
^
Category: Active Server Pages
File: /glenntest.asp
Line: 18
Column: -1
Description: Missing Language attribute
ASPDescription: The required Language attribute of the Script tag is missing.
sunilkumar said,
September 26, 2008 @ 10:40 am
Hi,
I want web.config file configuration for the redirect to work.
my url is http://www.localsaddda.com/games need to be transferred to http://www.localsadda.com/live-games. But i want it to be done in web.config file. Because i am using games folder in a different way. I was succeded in doing this but i did using 302 redirect.
So how to do 301 redirect using web.config?
Jimmy Bryant said,
September 25, 2008 @ 2:26 am
Thank you, this is just what I was searching for. The 301 redirect is exactly what I needed.
AffiliateMinded said,
September 23, 2008 @ 3:56 pm
Thanks Steven,
That gave me exactly what I needed to understand 301 redirect.
house dj said,
September 23, 2008 @ 11:30 am
Thanks for your help! But i have one question, are there any differences between thos redirections and the setup on my server? i’m setting the root the the other url. is this for the search engines the same?
The Credit Agency said,
September 23, 2008 @ 8:11 am
Excellent article - very clear and concise. I’m new to the 301 redirect and had come across many sites that had said what code to use, but none that actually explained where to put it and how to edit the .htaccess file.
Now that we’ve come across your article we will finally be able to implement the site changes that we’ve wanted to do without fear of ruining our search engine rankings or leaving our site visitors seeing page errors.
Many thanks!
The Credit Agency
web developer said,
September 23, 2008 @ 12:53 am
Good article, thank you. I develop in ASP.NET and ColdFusion, so it’s nice to see scripts for both platforms.
Also, this is the first time I come across your website, and I must say I like the look and style of it, so good job on that too.
liz said,
September 19, 2008 @ 3:14 pm
excellent! thank you!!
squirrelonfire said,
September 17, 2008 @ 11:26 am
thanks 4 the code, and could you put a social bookmarking button on the page too plz.
Pat Doran is Awesome said,
September 10, 2008 @ 11:54 am
Thanks for the tips. Very helpful.
graphic art said,
September 4, 2008 @ 12:47 am
Very nice article. However, can you also provide a sample code for www to non www? Thanks in advance
vovaNux said,
September 1, 2008 @ 2:06 am
Hello,
Thank you for this great tutorial.
1.
RewriteEngine On
2.
rewritecond %{http_host} ^yoursite.com
3.
rewriteRule ^(.*) http://www.yoursite.com/1 [R=301,L]
This code transmits all the parameters, Please, advice how to disable parameter transfer (taking off $1 does not solve the issue)
Jessie said,
August 29, 2008 @ 8:49 am
I’m writing becuz I like your web page. It’s really cool!
Oh yeah you info was very helpful as well =)
Mik said,
August 24, 2008 @ 9:55 pm
Great article and gives me some intelligent ways to redirect.
Rodzi said,
August 21, 2008 @ 5:55 am
Thank you very much. This is very helpful indeed. Great article by Steve & great contributions by those who commented.
Really appreciate this. Cheers!
ferash said,
August 19, 2008 @ 3:37 pm
thank you very much for sharing your knowledge. good articles.
riya said,
August 18, 2008 @ 5:14 am
hi,
i create one drop down box and in that two options are there and if i select first option it should go to 1.php and if i select second option it should go to 2.php ..how can i redirect this function.hope that you will reply me soon
Bobby CS said,
August 16, 2008 @ 4:12 am
This surely is a good guide for new comers. Thanks!
Doug said,
August 13, 2008 @ 5:42 am
thanks for the help, you saved me a bit of searching by having the redirect options very well spelled out. Nice site!! A+
ATOzTOA said,
August 9, 2008 @ 5:55 am
How to do a redirect in Blogger?
Marlon S. said,
August 9, 2008 @ 5:36 am
Steven,
I am a newbies. Please help me analyze my website on how to redirect permanently from themagicmic.com to http://WWW.THEMAGICMIC.COM.
I will really appreciate your inputs.
You have a good articles here.
Bullseye said,
August 3, 2008 @ 10:02 am
Which script would I use for my Google Blogspot to direct it to my new .com?
Gary Hall said,
August 2, 2008 @ 5:15 pm
Hate the evil javascript redirect. Due to budget used a static HTML editor. This article will help me immensely to publish my dynamic HTML. I currently am using the evil javascript redirect, my implementation actually contains a bug, which is not an issue now, but your way is cleaner. Thanks for sharing your knowledge. I also learned that I an handle the 404 error more cleanly.
ask siirleri said,
August 1, 2008 @ 3:38 am
thank you. good articles
Pascal said,
July 29, 2008 @ 2:12 pm
Its true, what you say about html redirects. Search engines dont like them.
Great article.
http://www.codesplunk.com/?s=c
Programming Language Questions & Review
cd boyz said,
July 29, 2008 @ 10:40 am
Thanks for the guide.I just applied it to my old domain. Let see whether the PR in the old website get transfer to my new domain or not!
Rob said,
July 23, 2008 @ 6:25 pm
All these redirect options and I still can’t get i to work…
Too bad my host isn’t any help either.
Gordon said,
July 21, 2008 @ 10:05 am
Great post, im trying to find the answer to something which i have been searching all over the net for.
I have a client and we are re doing their website which has many products that they sell online. The current site has been done in asp and our programmers use php. Currently their site ranks with certain products/pages on google etc and i wanted to set up 301 redirects to point any of these pages to go to the new site.
Can i do a mass redirect for any pages that will contain .asp to be redirected to the new sites addresses?
Designer said,
July 19, 2008 @ 7:59 pm
Among the most comprensive yet concise pages I’ve thus found while Googling for 301/404 redirects, etc .. your practical examples of code snippets are very helpful and appreciated
William said,
July 17, 2008 @ 4:25 pm
When marketing doesn’t consult on links they publish on flyers until after it’s already printed AND mailed, you end up with a .htaccess file. Works beautifully.
Thank you!
Chris said,
July 16, 2008 @ 8:37 am
Thanks for posting this information, I have found it very helpful.
In IIS7 the process for 301 redirects is a bit better. Here’s a post on how to do it:
http://sim.plified.com/2008/07/16/iis7-and-301-permanent-redirects/
You might want to add this to you list.
Thanks again
SEO Lady said,
July 9, 2008 @ 8:52 pm
This is a nice post. All 301 redirections in one place!
Brad said,
July 7, 2008 @ 3:33 pm
hello, was wondering if there is a way to use the php redirect to redirect into the “_top” attribute?? as I use an inline frmae on my site?
Jon said,
July 5, 2008 @ 12:09 pm
Thanks, very helpful, especially to a novice such as myself.
dorothy stoeger said,
July 4, 2008 @ 7:46 pm
Steven Hargrove,
If you are the Steven who recently took a DNA test, please contact me.
Dorothy S
SpotOn SEO said,
July 4, 2008 @ 12:24 pm
Very nice post Steve! This was exactly what I was looking for.
Phllip said,
July 3, 2008 @ 4:49 pm
I am trying to set up a Redirect solution for the local airport free wireless that would through up a terms and acceptance page and then to the home page for the airport then let them go to where ever they want to go. I have the home page set up but I can not find a device to do the redirecting and the airport does not want to spend a lot of money on the free wireless.
Increase Search Ranking said,
July 2, 2008 @ 9:17 am
We wrote an article on how 301 redirects may affect your SEO position, etc.
Thank you for providing a very simple how-to showing users how to do their own 301 redirects!
Sincerely,
CrackGoogle
natobasso said,
July 1, 2008 @ 2:30 pm
What do you do if you no longer have access to any of the old pages and can’t insert code for a 301 redirect? Do you add a disallow code for each page in your robots.txt file?
song networks said,
July 1, 2008 @ 2:18 pm
thankyou very good information
shopping blog said,
July 1, 2008 @ 2:16 pm
nice info thanks
Steven Hargrove said,
June 30, 2008 @ 2:52 pm
fnfzone,
I highly suggest that you do NOT use javascript redirection.
fnfzone said,
June 30, 2008 @ 10:20 am
How can i redirect using java script?
Service Calculatoare said,
June 26, 2008 @ 6:27 pm
oops, it seems that my post was considered spam, sorry for entering my url’s in the text. anyway, i’m glad i found this site, it helped me alot
Jan Meulendijk said,
June 26, 2008 @ 11:59 am
In response to Mike@sky (23 June): I tried to create a .htaccess file in BBEdit (my text editor) on a Mac and before saving got the warning that files starting with a dot are system files, and won’t be visible once saved. Not much help to know this, maybe, but knowing this might get you closer to a solution, as I seem to remember the Mac has an option to see system files which are normally hidden. Must confess that I don’t know offhand how to bring this about.
Stefan gavril said,
June 26, 2008 @ 6:54 am
Wow! I really needed some redirection alternatives. I successfully redirected http://www.servicedecalculatoare.com.ro to http://www.ctromania.ro and i’m really happy. Thank you very much!
Jessica said,
June 25, 2008 @ 2:32 am
THANK YOU!!!!
I used the PHP version. I know absolutly nothing about PHP and very little about HTML but your instructions were so easy to follow I was able to redirect from http://www.empoweryourvictory.com/phpbb3/main.php to http://www.empoweryourvictory.com. It’s a long story as to why I needed that but I very much appreciate all of your help!!!
THANK YOU!!!
mike@sky said,
June 23, 2008 @ 3:56 pm
i tried to use the .htaccess file to redirect, but it caused an internal error, now i can’t see the file on my server or on my mac, i can’t rename a different file to .htaccess either. what do i do? i can’t fix this.
JoaCHIP said,
June 23, 2008 @ 9:04 am
There are only one of the above methods that are not server-based. That method uses javascript. So what is the prefered redirection method, if javascript is not available, and we are dealing with html on a local filesystem (thus no HTTP headers possible)? I’d like to see this addressed by the above article.
Souvik Banerjee said,
June 18, 2008 @ 3:22 am
I’ve redirected my website from “http://www.souvikbanerjee.com” to “http://souvikbanerjee.com”, using the following code,
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.souvikbanerjee\.com
RewriteRule ^(.*)$ http://souvikbanerjee.com/1 [R=permanent,L]
After doing this, when I am clicking on archives or categories it is showing, “Not Found”. Now what change should I make in my .htaccess file to make all these work? (You can visit my site for reference.)
V. Gee said,
June 16, 2008 @ 2:09 pm
Is there a way to set up a 301 redirect, if the old site is cancelled? I saved the most important URLs from the old website, but I just found out that I need to put the htaccess file with the old site.
Am I screwed?
Thanks.
hnghjn said,
June 14, 2008 @ 2:00 am
hsuidfhsuifhudshgvj hggyjhdfj vbjhvjbvb vjdfihd fgv dfkvv
Colin Miller said,
June 13, 2008 @ 3:30 pm
Great stuff! I have been using the old html method of redirection, but after reading this I will be going down the mod_rewrite road, much cleaner! Thanks very much
andrew hanson said,
June 9, 2008 @ 7:17 pm
i am trying to update a site that uses xml as it’s base.
basically i want the person visiting my site to be able to type into this simple URL http://www.example.com/gallery (which does not exist in any of the coding) and then be redirected to http://www.example.com/intricateURLwithpictures
Is this something I can update in my XML file? or is more complicated than that?
thanks,
andrew
highway4 said,
June 4, 2008 @ 3:42 pm
Thanks for this helpful information. One question, for a ASP Net site, there we are looking at changing ONLY a handful of current URLs on internal pages, for example http://www.example.com/c-example.aspx to http://www.example.com/d-example.aspx. Should we add the 301 redirect code in each affected page in the method above for IIS, or should we do it by each affected page using the code written below 301 Redirect Using ASP .NET? Thanks for your help.
Joe B said,
June 4, 2008 @ 3:40 pm
I tried this as a suggestion from hubspot to consolidate my search engine link counts — well, I found that for the members, which require a login via .htpasswd, etc., it never gets to the login if they come in with the “wrong” site name. I have not been able to figure out how to fix this.. If they come in with the redirected site name, they immediately get “bad password”.
How do I fix this interaction problem between the rewrite and apache’s login process?
Thanks!!
USNaviguide said,
June 3, 2008 @ 12:50 am
Thanks! That was easy.
Steve said,
May 22, 2008 @ 12:16 pm
Hello,
I am posting an ad on classifieds.com and like other website owners, i would like the buyer to click the headline and then get redirected to my site. I don’t know what code these site owners put in the classified ad. Can you tell me what I need to type ? Thank you very much for your help.
nebojsa said,
May 18, 2008 @ 9:39 am
What is recommended way of redirecting in case that you have a web site at place like GeoCities.com where you cannot implement php, -htaccess or similar techniques ?
thanx
kent said,
May 17, 2008 @ 12:38 pm
i try 301 Redirect Using htaccess,ex..
Redirect 301 mydomain.com http://www.mydomain.com/default.html
it not work , maybe miss step and will try again
Mike said,
May 17, 2008 @ 9:29 am
What about re-directing certain pages/folders in asp.net, not an entire site? My site is dynamic and I have a folder with thousands of indexed pages and the URL has changed.
prahlad said,
May 14, 2008 @ 5:40 am
Dear
Thanks for information but can you tell me where we use this code at our web page or server i mean site rote
Rene said,
May 13, 2008 @ 7:28 am
Hey Steven,
Thanks alot for your simple explaination. Much appreciated!
Rene
RotoNation said,
May 12, 2008 @ 4:40 pm
Thanks, worked like a charm!
jonny said,
May 9, 2008 @ 6:02 am
Hi. Great article, simple and easy to understand.
However what if you have multiple pages to redirect? Do you create a separate htaccess file for each one or do you just add more lines in the one file?
Also once you have the htaccess in place can you then delete the original html (in my case) page?
alex said,
May 3, 2008 @ 2:31 pm
Hi, very interesting article. I have one question on redirection.
how can be done, if someone (in asp.net) type
http://www.example.com/car
and not
http://www.example.com/car.aspx
???
Can this be done somehow?
if it was in php (i think) it wouldnt nesessary…
Andrew said,
April 30, 2008 @ 2:39 pm
Man I learned the hard way with the HTML redirect. I’m now using the php method and was able to get back on the right track. Cheers!
SEOGuru said,
April 28, 2008 @ 6:55 am
Guys,
We are switching our website over from .html to .cfm after a major update.
Unfortunately as we’re on a shared windows hosted server we have no access to the IIS settings. Is there anything we can do (bar move server) that will allow us to redirect these pages?
Also how do we go about dealing with the .html pages that are not going to appear in the updated site. Is there some code we can introduce on the html files that tells the search engines that the page is no longer in use?
Bill Rolfes said,
April 22, 2008 @ 3:17 pm
I just had a need to redirect an old web page that appeared on a Google search, and found your article on 301 redirect. Since I have just a single small site I’ve just used a simple web publishing program, and was not familiar with how to do a redirect.
I came across the page you published couple of years ago; thanks for the information; it seems to work fine for me!
metin said,
April 20, 2008 @ 11:55 am
What if I want only a certain page of my blog/website to direct to another website/page, but I want the end user not to see the redirected page, but still see my page’s hyperlink on the address bar? What’s the best method for that?
Thanks!
Pradeep said,
April 19, 2008 @ 5:17 pm
Hello ,
Really nice post, i got the term what i was looking.
Thanks a lot
Pradeep Tiwari
Tom Grimshaw said,
April 18, 2008 @ 8:41 pm
Steven, thanks very much for taking the time to write it all up! I went looking for why my html redirects were not working and you have provided a much better solution, cleaner, more elegant and recommended.
Majesticskull said,
April 17, 2008 @ 2:18 pm
Very good! I use the first solution and works very well.
Thanks!
neo said,
April 17, 2008 @ 1:36 pm
want to redirect from old website to new one old websites are:
http://arcadiazone.page.tl
server is on http://www.own-free-website.com/login.php, using website templates, as i don’t have access to the header on my pages what is the best action to put redirect when new website is finished
ltlucky said,
April 16, 2008 @ 4:45 pm
So I’m using Yahoo web hosting and they don’t permit use or modification of the .htaccess file.
I just created a php version of my html site.
I’m guessing that the correct answer is to cancel my yahoo hosting and go with another company that let’s me use .htaccess, right?
Any other ideas?
Krishnan said,
April 15, 2008 @ 12:30 pm
I have situation where I want the page to be redirected as follows
user gives https://abc.efg.com/ he should goto https://xyz.com/index.html
for any thing like https://abc.efg.com/XXXX should not be redirected.
this is because my application does not have a home page, user always has to login through the xyz.com . once logged in user can come to my application.
Please help
Cat said,
April 8, 2008 @ 7:37 pm
Hi Steve, was talking to you earlier but we got cut off.
I was wondering how I can redirect from http://www.mamatales.com/forums to http://mamatales.com/Joomla/index.php?option=com_fireboard&Itemid=79
We tried the standard 301 redirect .htacess file it did not work, and you tried another one with me dont recall exactly what it was. But if you can email me back or I will try to catch you on chat.
Thanks,
Cat
patrice said,
April 8, 2008 @ 5:56 am
A site I volunteer at was set up to be accessed as http://site.org and NOT as http://www.site.org. I’m looking to redirect people who log into our site using www to the ‘plainer’ URL, but have been unsuccessful with variations of the 301 directions here (which I have used with success on other sites when redirecting to another, entirely different, URL). Is what I want to do possible?
Wayne Herbert said,
April 7, 2008 @ 12:08 am
Hello, great article, learned a lot. I originally set up http://www.myco.com. Later, I grabbed another domain http://www.mycompany.com. I created some content in http://www.mycompany.com/content and using the redirect facilities within my Linux hosting (a 301 redirect I now understand) I set up content.myco.com to redirect to http://www.mycompany.com/content and it works just fine, except:
I would like to keep the URL that is displayed as content.myco.com. I read most pages of messages in this thread and have not found the answer. Is there a way to do this?
Many thanks.
Rob Meades said,
April 6, 2008 @ 5:18 am
S’OK, found out that Redirect doesn’t send on query strings, you have to use RewriteRule instead. Maybe worth adding this as a note (unless I’m wrong!).
Rob
Rob Meades said,
April 5, 2008 @ 5:36 pm
Very comprehensive advice indeed, very glad I found this.
One question: I’ve tried using redirect on my local server (Apache 1.3) and it works successfully on a static page. However, if the redirection is to the server in my webcam and the requested URL is a CGI script that takes a parameter (”img/image.cgi?next_file=main_fs.htm”) then the page doesn’t form correctly. It looks as though the parameter is going missing. Is there something extra I need to do to get the parameters to go with the redirection?
Rob
Marshall said,
April 3, 2008 @ 2:16 am
Thanks! Not only does this make it easy to keep people from accessing files that you don’t want them to, but it also makes it possible to still have the files on the server for future access if necessary. This could be a life saver for many.
Ellen said,
April 2, 2008 @ 11:52 pm
Excellent article. Found it searching for the redirect…much better way to do it.
Marg said,
March 31, 2008 @ 5:29 pm
Just a quickie to say… Hey Thanks!!
Eddie said,
March 29, 2008 @ 10:23 am
You Da Man Steve. Thanks for the invaluable insight. I have many times wondered how to do this and it was solved in just 5 minutes. You have my deep gratitude.
Kevin said,
March 22, 2008 @ 8:53 pm
Thanks so much for including all of these examples, BTW.
Kevin said,
March 22, 2008 @ 8:48 pm
Oops, I didn’t turn my angle brackets into entities! Here’s try #2:
For anyone looking for ColdFusion redirection, it is done this way:
<cflocation url=”myNewURL.cfm” statuscode=”301″ addtoken=”no”>
The attribute “statuscode” is new with CF8. This tag actually allows any of the status codes to be used, but of course for permanent redirection you need 301.
Here’s more info in the documentation:
http://livedocs.adobe.com/coldfusion/8/htmldocs/
Kevin said,
March 22, 2008 @ 8:46 pm
For anyone looking for ColdFusion redirection, it is done this way:
The attribute “statuscode” is new with CF8. This tag actually allows any of the status codes to be used, but of course for permanent redirection you need 301.
Here’s more info in the documentation:
http://livedocs.adobe.com/coldfusion/8/htmldocs/
Barry said,
March 20, 2008 @ 11:20 am
What if I want a redirect based on some condition?
Links de websites utéis | Yeltsin Lima said,
March 19, 2008 @ 9:22 pm
[…] Redirecionando páginas, da melhor forma […]
100+ Resources for Web Developers « Share4Vn.com Blog said,
March 19, 2008 @ 6:04 am
[…] How to redirect a Web page the right way Don’t lose PageRank! Steven Hargrove gives you the code to redirect using htaccess, Mod_Rewrite, […]
stone said,
March 18, 2008 @ 5:30 pm
what if if i want the old page to appear for some time ( lets say 15 seconds ) and then go to new location ???????
Top 15 Resources for Web Developers « Digg Duhh said,
March 16, 2008 @ 6:08 pm
[…] How to redirect a Web page the right way Don’t lose PageRank! Steven Hargrove gives you the code to redirect using htaccess, Mod_Rewrite, IIS, ColdFusion, ASP, Java, Perl, Ruby and PHP […]
100+ Resources for Web Developers « arcagility said,
March 14, 2008 @ 11:42 am
[…] How to redirect a Web page the right way Don’t lose PageRank! Steven Hargrove gives you the code to redirect using htaccess, Mod_Rewrite, […]
Steven Hargrove said,
March 14, 2008 @ 12:14 am
Stacy - Make sure you’re redirect is not set up to redirect to a page where the same redirect code will get triggered. This will cause an endless loop of redirecting, in effect causing an internal server error.
In other words, A should redirect to B, if A redirects back to itself (A) - you will get an internal server error.
Stacy said,
March 13, 2008 @ 7:17 pm
I’m having some major trouble doing this. The code is very simple and I feel like I’ve been up since last evening trying to figure out how to hold a spoon in my hand. Apparently, the htaccess file is not a problem since I’ve tried all the codes and they’re right. The redirection works to something like msn.com, but when I do it to my own site, there either is no response or I get an internal server error or that the redirection can never be completed.
Where does one look once the htaccess file is of no help anymore?
100+ Resources for Web Developers | BlogWell said,
March 4, 2008 @ 10:03 am
[…] How to redirect a Web page the right way Don’t lose PageRank! Steven Hargrove gives you the code to redirect using htaccess, Mod_Rewrite, […]
How to redirect a web page, the smart way at Ehsan Mahpour’s Weblog said,
March 3, 2008 @ 2:12 pm
[…] Anyways, whoever is interested to read it can go to his weblog and read it. Click here […]
Steve said,
February 29, 2008 @ 8:08 pm
Great tips, thanks for the help.
I’m just wondering if it’s possible to use mod_rewrite to redirect to a different domain.
I need to move my site from a .com to a .net. All the url’s are identical apart from the TLD.
For example, I need over 3000 pages to redirect from
http://www.mysite.com/pagename.php
to
http://www.mysite.net/pagename.php
Is this possible?
How to redirect a web page, the smart way at Ehsan Mahpour’s Weblog said,
February 29, 2008 @ 4:02 pm
[…] 301 Redirect Using htaccess […]
ofisboy said,
February 28, 2008 @ 12:15 pm
Rob, check your configuration.php. Somewhere in there you will see a path to your site without the “www”. Just add the www to that path and your problem will be solved.
Domain Squatters and Redirecting Links from a Blog | WebDiggin.com: An Adventure to Make Money Online said,
February 23, 2008 @ 2:30 am
[…] Steven Hargrove has a website on some cool web stuff and Search Engine Optimization info. He says the following about using HTML and meta tags to redirect: HTML RedirectionHow do you redirect using html you ask? Here is how: DONT! […]
Rob said,
February 23, 2008 @ 12:06 am
Hi,
Im wondering the proper html code to add to my frontpage website that would redirect my http://vacationrentalexperience.com to http://www.vacationrentalexperience.com
It seems that some of my changes i make to my web pages go to the http://vacationrentalexperience.com url instead of the http://www.vacationrentalexperience.com help!
djhassoo said,
February 20, 2008 @ 3:21 am
oh God, atleast i got it after searching so long, Thanks for sharing Mod_rewrite redirection code.
Nice Theme
Paul said,
February 15, 2008 @ 1:43 pm
sorry to bother you. Many years ago, with the help of MS Frontpage I made a web site for a friends golf league. The home page is index.html and I guess geocities requires that. I need to redirect.
> Can you help?
Colorado Small Business Blogging » Blog Archive » Not Redirecting Your Web Pages is Just Plain Rude said,
February 14, 2008 @ 8:14 pm
[…] Many Redirection Examples […]
El guardián del faro said,
February 11, 2008 @ 8:33 pm
[…] y como realizarlas, porque hay muchos que lo han hecho ya, y bien, entre ellos Presunto Culpable, Steven Hargrove (en inglés) y EmezetaBlog entre otros muchos. Yo quiero hablar de eso otro que no suelen explicar […]
Riscrittura delle URL e caratteri speciali e accentati - URL rewriting | Andrea Vit 's blog said,
February 6, 2008 @ 5:07 pm
[…] vantaggio della riscrittura delle URL è bene prevedere almeno nelle pagine di primo livello una redirezione 301 dalla URL codificata stile “Wordpress” alla URL codificata in […]
SEO Friendly 301 Redirects | Yakiji said,
February 4, 2008 @ 2:31 am
[…] How to redirect a web page, the smart way (Steven Hargrove) Posted in SEO Tips […]
sj said,
February 4, 2008 @ 12:40 am
Steven,
I’m having trouble with the 301 redirect on my web site. I’m trying to use it to redirect page names that are no longer current after I have updated/renovated my web site. I do use URL rewriting, and my developers are telling me this is my problem. Here is what happens:
This redirect line:
301 redirect /item_23.html http://www.mydomain.com/Item_Name
yields this:
http://www.mydomain.com/Item_Name?SpeakerName=/item_23.html
instead of:
http://www.mydomain.com/Item_Name
Do you know why? Do you know how I can fix this? Thank you.
Shawn said,
February 4, 2008 @ 12:21 am
Steven, I’ve just built a new site to replace my existing site — updated programming, new features, etc. — so pages have new names. Right now, I have the new site hosted on a temporary domain, on a new host. I’m ready to redirect my DNS to the new host and make the new site my “live” site, but I don’t want to do that until I have the 301 redirect issue settled. I tried using the .htaccess code above, but I got a server error.
Both my sites are database-driven, product catalog-type sites, so I have about 300 pages to redirect. The old page name format is /item_123.html. The new page name format is /Item_Name. The domain will remain the same. I have URL rewriting on both sites, though, and my web developer is telling me this complicates the 301 redirect code. Can you offer me any advice? Here are the URL rewrite codes for each site, from the .htaccess files, in case you need them:
old/current site:
RewriteCond %{REQUEST_URI} !item.php4
RewriteRule ^item_([0-9]+)\.html$ /item.php4?id=$1
new site:
RewriteRule (.*)\.htm$ page_info.php?pagelink=$1
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule (.*) index.php?ItemName=$1 [QSA,L]
I’m not a programmer, so I’m giving you the info I have. I’m trying to find out what the appropriate 301 redirect code would be so I can give it to my developers.
Thinking of changing domain names? » 404 Group said,
February 4, 2008 @ 12:10 am
[…] on, you will need to use different methods for setting up a proper 301 redirect. Here’s a comprehensive blog post, and another, and here’s a forum with great detailed discussion about […]
matt said,
February 1, 2008 @ 6:19 pm
nice list for redirect, I paste this…
LL said,
February 1, 2008 @ 11:04 am
Do you know of any issues with using a Domain service to forward and mask a site. I am having an issue with my forwarding not working in IE7 upon initializing the IE7 browser. Works fine in Firefox and Opera
Or is it just best to do it yourself? Can you code a mask in your own code?
paul said,
January 31, 2008 @ 6:09 pm
i want to forward http://www.mydomain.com to http://www.mydomain.com/newdirectory so i created the .htaccess file below:
Redirect 301
/index.php
http://www.mydomain.com/newdirectory/index.php
I uploaded it to the root directory along with an empty index.php but it didn’t work. Did I do something wrong?
Bruce Rhodes said,
January 29, 2008 @ 10:45 am
Here’s a park/multi-domain name question….
I have multi-domain names (safeguardselfstorage.com, …etc.) parked at safeguardit.com
Is this a bad practice for SEO?
Also I use the Google Maps API key has to be generated for each domain name that I have parked in order for the map to work…what a hassle…
Is there a better way? Please advise QUICK! as you are able …thx!
Cheers!
Crockett said,
January 28, 2008 @ 8:31 pm
This is the most comprehensive, server-neutral answer I have found to date! Now I can enhance my CMS with a 301 option instead of just a fancy 404.
Thanks, and rock on with your bad self,
Crockett
Preity said,
January 24, 2008 @ 7:29 am
Thanks for the info. Its really of gr8 help. I would be applying the method “301 Redirect Using htaccess”. My site http://www.hgtechsolutions.com is being redesigned from html to php. So the urls have been changed. Should i need to specify, for each url, a new url or have to copy this code only once? pls advice soon. its urgent! Means i have to write Redirect 301 /index.html http://www.hgtechsolutions.com/index.php … like this specifying for each page in .htaccess file?
Marvin said,
January 20, 2008 @ 12:38 pm
Great information, very valuable and practical advice, especially for those looking for a major site revision - such a me for example. Getting it right the first time is really important.
Ali Akbar Khan said,
January 19, 2008 @ 12:25 pm
Dear Steven,
I am using a free hosting server for my articles site. its can not allowed .htaccess for redirection for pages. I am using Article MS Script for my site. Tell me how i can redirect all pages on their links through php script and where i post this code for redirect pages to exact page location, like http://www.articleszone.co.cc/submit/ link with Submit Article. I am a not familiar with coding.
Thanks
Malik said,
January 18, 2008 @ 5:24 pm
Great stuff thanks for this. I was going to do it the meta tag way and said let me do some research first.
Thanks,
Sridhar Katakam said,
January 16, 2008 @ 1:25 am
How do I redirect visits to all the pages of my website to a particular URL?
Lisa said,
January 14, 2008 @ 7:21 pm
I just had this tech dude with Godaddy.com tell me about 301 Redirect in a 10 second sort of way.
My question was for me to take a Flash movie they have available via their “Website Tonight” platform serve as my home page. And have this redirect to my own FTP pages.
You see, they either offer FTP OR Website Tonight (with flash). One or the other.
So his fix for this was: Use Website Tonight for your FLash and have it do a “301 Redirect”.
Kind of a ‘Driveby’ “explanation”. So what is this guy saying?
Blake Lewis said,
January 14, 2008 @ 1:52 pm
Great tutorial! Thanks for sharing!
kris said,
January 11, 2008 @ 12:43 pm
Thanks for the info!
I’m setting up a new website with a CMS.
All products will be situated at another URL.
Your info will help a lot.
THX
Kris
zhakee said,
January 11, 2008 @ 12:05 pm
Your information is great, but I’m not sure how to go about doing the following:
I have two mirror image sites at blogspot dot com and I would like to redirect folks who visit one site, to the other. Where exactly would I paste which code so people visiting the blog get redirected to the other, AND, how would I notify them to update their bookmarks?
The blog allows access to the code, but where in the code does this message go? Or?
Thanks so much.
Chris Schaffer said,
January 11, 2008 @ 10:11 am
Pure awesome on the amount of information you have given on every way to perform a good redirect!
I know I will be using this as a reference and recommending it to others.
Revantine, The Life and Times » Blog Archive » www1 vm said,
January 10, 2008 @ 6:19 pm
[…] I forwarded the old webmail address to the new webmail address. This is a great site for different 301 redirects http://www.stevenhargrove.com/redirect-web-pages/ […]
Status code HTTP e SEO - qualche consiglio utile | Andrea Vit 's blog said,
January 9, 2008 @ 5:42 pm
[…] come redirigere le richieste HTTP con i più diffusi linguaggi di programmazione e web server; […]
Ryan B said,
January 9, 2008 @ 4:07 pm
Great help, thanks! Question though…what if I want any page from our old site to redirect to our new site… example. no matter what someone types in http://www.oldsite.com/page1 or http://www.oldsite.com/blahblah but I want it all re-directed to http://www.newsite.com. Is this possible? Thanks!
Ryan said,
January 8, 2008 @ 10:07 pm
Wow, thanks for the great tips. This made my life much easier after upgrading my site.
Stephen Bussard said,
January 6, 2008 @ 8:13 pm
This is a good article because it’s bite sized. It’s a good tip that I typically wouldn’t consider doing otherwise. It’s always good to encounter other professionals in web development in a world of drag and drop.
John said,
January 6, 2008 @ 4:51 pm
What if I want to redirect to a subdomain?
For example->
subdomain.domain.com
redirected to
http://www.domain.com/example.html
Karlo said,
January 3, 2008 @ 12:49 pm
Thank you so much! Very helpful information!
SEO said,
January 3, 2008 @ 3:42 am
Nice contribution…Very useful information for those who want to redirect their web pages.
Kumquat said,
December 31, 2007 @ 6:55 am
HI & Thanks…
Here comes the dumb, sincere question…
but…I need to redirect from an empty server root to a subdirectory in the same hosting that can handle numerous domains. We have several domains pointing to the same pages…which lead to a joint, small eShop, not surprisingly.
Apache on Linux, commercial shared hosting that requires either the real pages or and htaccess file in the root
Previously there were html pages in the root, but we built new pages in php and put them in a hosting directory called /new…coming off the hosting root, obviously
Then we erased the html old (&ugly) pages.
Problem is other domains also point to the /new hosting directory, so it is a BIG hassle
Many thanks for the help, everybody!
Liz said,
December 24, 2007 @ 11:45 am
Wow! Thanks so much for the info on redirecting. I really appreciate it. I used it to redirect from an old subdirectory to a new domain. Thanks!!
Steven Hargrove said,
December 21, 2007 @ 11:46 am
bleed,
Thank you very much for letting me know about this.
bleed said,
December 21, 2007 @ 5:16 am
hi… you got spamlinks in your code (no longer) linking to our site (thats how i noticed), that you can only see if javascript is turned off. to get rid of them check your footer (there is probably an additional and unwanted wp-footer include, more info here: http://wordpress.org/support/topic/123108/page/2). btw. they come back if you do not update your wordpress installation.
Dainų tekstai said,
December 13, 2007 @ 4:46 am
Thanks for it. Very useful. But there is any solution with PhP to leave previos url when page redirect to new page?
Frank Seidan said,
December 11, 2007 @ 10:46 am
How can I do in VBScript from client side if first URL is not avaialble , go to 2nd URL or so on.
Frank
Kent Website Designer said,
December 8, 2007 @ 11:01 pm
Great Article,
Now I really know all ways to redirect pages, especially avoiding duplicate content penalties with a new domain im working on.
Thanks
Fernando C said,
December 3, 2007 @ 10:45 pm
i tried doing the “.htaccess” and my server wont let me upload the file?
Mana Media said,
November 30, 2007 @ 11:32 am
Dear Steven - thank you sooo much for all of the information supplied on this page. Much Appreciated.
Team Mana Media
naisioxerloro said,
November 28, 2007 @ 5:12 pm
Hi.
Good design, who make it?
Tim Lutz said,
November 25, 2007 @ 9:11 pm
I’ll add one more to the list of thank you’s for this. I could find lots of stuff on .htacess, but I’m hosted on a Windows server… The .asp script worked like a charm and I couldn’t find this type of help anywhere else!
Liz said,
November 25, 2007 @ 3:18 pm
I just tried the htaccess solution and it works like a charm. Thanks for the straightforward advice.
The problem was that a newsletter someone else sent out linked incorrectly to a page. The “.” was left out before the “php” so the address (in part) read “birdsphp” instead of “birds.php”
Since the page uses php script, making a duplicate page to match the incorrect link wasn’t an option. Yet even with this messed up link, the redirect using .htaccess does the job.
Hiren Adesara said,
November 24, 2007 @ 8:30 am
Hey,
I want to redirect my university webpage to my blog. I tried creating a .htaccess file and putting that code into it and removing the existing index.html file. But still it doesnt work. Its still showing up the old index.html file. Can you please help?
Hiren
Tracey said,
November 22, 2007 @ 12:45 pm
So, how would you use a 302 redirect when you need to rewrite an unsightly URL?
Sachin said,
November 22, 2007 @ 4:10 am
Hello,
I want to redirect one html to another html page, so what code should i put in the HTML file? the files are on Windows server.
Please help.
Thank you,
Sachin
Steven Hargrove said,
November 21, 2007 @ 11:27 pm
David,
You’re rankings haven’t been “lost” in the technical sense, however it is being “forwarded” to you’re new domain, or new page, this is a process that is not instant, and frankly I do not know the exact time.
As for you’re page loading issue, you should consult with your web host provider.
Hope that helps,
Steve
David said,
November 20, 2007 @ 8:25 pm
I used the Coldfusion solution about a week ago, now i have lost all my rankings . Also when i click on an old link that’s listed on a 3rd party website i can see the new page name appear in the url address bar but, the page fails to load. When viewing the page source i can see part of the page have been loaded.
Any reason why ive lost my ranking and why my pages are not loading?
Regards
D
Xstamper said,
November 20, 2007 @ 2:41 pm
Cool info. I’ll have to keep this in mind.
jesper said,
November 20, 2007 @ 3:28 am
Hi Steven,
Thanks for a great article. I am using 301 in php and asp.
I browsed through all the previous replies but don’t think I saw anyone with my simple problem.
A client’s website has been purchased by another company, and the old domain should point to the new domain. However, besides 301-redirecting to keep the indexed pages and pagerank, I want to be able to “add a page” with information to the user about the change… i.e. “Hi visitor. Company B has now purchased company A and the new website is located ad http://www.company-b.com“.
Is there any way to do this? The current website is on windows server runnning asp.
Thanks a lot,
Jesper
Matt Scilipoti said,
November 16, 2007 @ 3:14 am
As of [7820] on 2007/10/09, Rails has a new redirect option.
# Examples:
# redirect_to post_url(@post), :status=>:found
# redirect_to :action=>’atom’, :status=>:moved_permanently
# redirect_to post_url(@post), :status=>301
# redirect_to :action=>’atom’, :status=>302
http://dev.rubyonrails.org/changeset/7820
Robb said,
November 11, 2007 @ 7:34 am
Can I get some advice re: 301 ASP.NET redirects? (never done a redir before)
You say add this code to your page or script, which page? (probably a horribly stupid question, but everyone is a beginner sometime)
If I have http://www.old.co.uk/blue.html - and I want anyone who keys in http://www.old.co.uk/blue.html to go to http://www.new.co.uk/blue-new.asp, where does the 301 ASP.NET code go, on the new site, the old site, where?
I can understand the .htaccess concept ok, but not this part. If you can point me to a relevant source I’d really apreciate it, thanks.
Derich said,
November 7, 2007 @ 12:22 am
Could I get some advice? I have about 25 domain names that are hosted in one location, using Linux, and 1 of the domain names managed by my ASP for the shopping cart solution in another location. For all intents and purposes, I don’t think any have any page rankings yet, but I wanted all of the remaining names to point to the shopping cart. Is a PHP or htaccess 301 redirect the best solution for this?
I am also in the process of setting up SSL on the main domain name and I wanted to make sure that when the other names get indexed or spidered that any redirects wont negate the SSL. I don’t think it will but I am not an expert on this side of the business.
Any help would be great….:)
raul said,
November 6, 2007 @ 6:12 pm
http://www.drmagner.com
i cant redirect all my html pages to php
MeetHalima said,
November 6, 2007 @ 5:34 pm
That’s a pretty darn nifty how-to guide you got there. I used the “301 Redirect Using Mod_Rewrite” and it worked like a champ. Thanks a million.
Internet Marketing Consultant said,
November 6, 2007 @ 5:58 am
Thanks for 301 redirect info.
It really helped me.
wrecked said,
November 6, 2007 @ 2:43 am
i want to redirect my websites http://autobuysell.wsnw.net/ to http://autobuysell.wsnw.net i tried but due to lack of programming language i was just able to revert it.
Jayson said,
November 2, 2007 @ 1:05 am
In my control panel in bluehost I set up the 301 redirect. Do I need it on the web pages too? It’s just two domain names and no content?
Vincent said,
November 1, 2007 @ 4:30 am
If i have only the domain name and no space then how can i redirect it to other website?
Blogging Secret » How to Redirect a Web Page said,
October 31, 2007 @ 7:04 pm
[…] best way to solve this problem is to set a 301 redirect, but I have never tried before as I have little confused about the coding of 301 […]
Visitor235 said,
October 30, 2007 @ 6:16 pm
I have visited your site 234-times
Corey said,
October 26, 2007 @ 1:47 am
I just finished moving a website and I used your PHP code snippits to do the redirects from the old site to the new site, it worked great! Thanks!
Avi said,
October 20, 2007 @ 10:42 am
I couldn’t create a file named .htaccess , there couldn’t be a file with no name but extension, or I can put whatever I want in the file name?
Ivan said,
October 19, 2007 @ 9:19 pm
That’s what I was looking for! The .htaccess redirect works great! Thank for posting this info.
Iris said,
October 17, 2007 @ 6:35 pm
Steven, thank you for posting this solution. I had to forward old links from a different domain name, the 404 page didn’t work in IE7 (and only in IE7.) When I saw your page, I knew I had the answer.
My client and I thank you!
Mike said,
October 15, 2007 @ 3:35 pm
What if I am re-directing to a completely different domain/site? I noticed that yahoo has now picked my new domain in the listings, am I going to lose ranking? Because the site has different content…..but geared around the same content that I had on olds site.
Thanks
Mike
naruto said,
October 13, 2007 @ 9:53 pm
this info was really useful, I am very satisfied with it, you even pasted a Perl code (the one that I use). thank you, very thank you! I can continue with a website project now.
Andy said,
October 11, 2007 @ 11:43 am
Is there a “multile random url redirection” web-service out there?
I would like to have one shorturl which redirects visitor randomly to my pages.
Thanks.
bryan smith said,
October 3, 2007 @ 9:00 pm
How do you do a redirect for a html/htm file to a PHP file?
Pat said,
October 3, 2007 @ 5:55 pm
How can I apply this to Dreamweaver? Thanks.
A “Basic” SEO Checklist | Alaska's Best SEO said,
September 28, 2007 @ 11:28 am
[…] into the browser, it should redirect you to http://www.mygreatdomain.com using a SEO friendly 301 redirection […]
Chris said,
September 23, 2007 @ 2:39 am
Is there a way to do the 301 redirect to redirect all pages that are *.html to *.php? In other words, wildcard it so anything they enter .html will get redirected to the same page in .php?
Thanks!!
Duncan said,
September 21, 2007 @ 10:54 am
Great information, clear and easy.
Using the 301 in htaccess it is vital to get the URI’s correct without any inadvertent spaces in each of the addresses (Old + New), a space will throw a 500 Internal Server error.
Found that out after a few heartstopping moments when testing.
Thanks
Duncan
hiutopor said,
September 18, 2007 @ 8:55 am
Hi
Very interesting information! Thanks!
Bye
barani said,
September 17, 2007 @ 3:45 am
hi all
Eric said,
September 15, 2007 @ 8:42 pm
Very cool, I found this very helpful. Thanks!
Steve said,
September 12, 2007 @ 6:23 am
…..just read the rest of the page on ASP and Java solutions……what a noob i am..!
Steve said,
September 12, 2007 @ 6:20 am
what about windows servers?? You cant use .htaccess on those, so dead links or old pages have to be redirected somehow. HTTP html redirects are the only way. Yea, the site page gets reindexed but its better than having visitors view old pages or see HTTP errors. Can lose visitors permanently that way. I guess there needs to be a balance between SEO optimisation and visitor retention.
Sumit Chauhan said,
September 8, 2007 @ 8:21 am
How can, I 301 redirect from http://www.xyz.com/shop.html?shop=http://www.abc.com/battery.asp
to http://www.abc.com/battery.asp through ASP.net.
Thanks,
Sumit Chauhan
Money | Car | Health » Blog Archive » Social Media Marketing Strategy #1: Re-Submitting Linkbaits for Viral Success said,
September 7, 2007 @ 8:17 am
[…] you. Some of the social websites block the old url so create a new URL for your linkbait page and 301 redirect the old […]
Social Media Marketing Strategy #1: Re-Submitting Linkbaits for Viral Success said,
September 5, 2007 @ 5:29 pm
[…] you. Some of the social websites block the old url so create a new URL for your linkbait page and 301 redirect the old […]
Dee Jarvo said,
September 4, 2007 @ 5:38 pm
I have a site on a windows server. Some of the links in google reflect the root URL (i.e. url.com) while others point to http://www.url.com. Is there a way to streamline the links to point just to the http://www.url.com the way htaccess does? Thanks!
Archna Sajwan said,
September 3, 2007 @ 12:51 am
Thanks for the very useful information. This is what I’ve been looking for. Very well explained
Faith Emrich said,
August 29, 2007 @ 10:30 am
I just wanted to say a BIG THANK YOU for all of your insight and suggestions on this page. A department in our city had mailed out a survey to the community with an incorrect URL in it. I used the IIS redirection instructions to redirect them from the bad URL to the correct URL, and it worked beautifully. I have earmarked this page and you! Again, appreciate the help.
Faith
ruud said,
August 26, 2007 @ 1:46 pm
Hi,
Thanks for informations.
I’m looking for a diffirent redirection like this;
if url has xxx word, visitor will redirect to main adress http://www.abc.com
Please help about this subject.
Thanks.
spiderman05 said,
August 11, 2007 @ 11:14 am
Thank you very much for this tutorial. I switched my pages from HTML to PHP recently and was about to add HTML redirects to my old pages, though an inner voice kept telling me not to do so. I will try the .htaccess solution.
Spiderman05
MacMonkeyMark said,
August 6, 2007 @ 6:56 am
This is really cool. Thanks so much. But I have a question.
Is it possible to do a redirect on a path? I have a PHP news script running and for all sorts of reasons, I’ve had to change the location of the updated news script. But the old path is still linked to around the net.
Many visitors still come into this path: ../news/comments.php?id=(..any number between 1 and 600 right now)
But I need them to come to this path../news3/comments.php?id=
I can do the redirect just fine in the comments.php but it drops the “?id=…” part. Is this doable?
Many thanks in advance!
Brian Sharaga said,
July 27, 2007 @ 11:40 am
Hi Steven,
I don’t know if this has been asked before. Windows doesn’t allow me to name a file “.htaccess”. It returns an error that says a file name is missing. I guess it requires the format: “filename.suffix” Is there any way to get around this error? I know AIX/Unix allows filenames that begin a dot.
shery said,
July 26, 2007 @ 1:41 pm
thanks for the informations really helped me a lot.
M Jo said,
July 26, 2007 @ 1:13 pm
I’m with JC also known as Conrad. That’s exactly what I’m looking for. I have the added problem, however, of having no access to any top level files at citymax. I think I can only get into the individual html pages. I’ve been looking at this subject for about six months and don’t know how best to do it.
Conrad said,
July 25, 2007 @ 4:16 am
Hi Steve,
I want to redirect every page in an old website to a new website that is totally different from the first one, so the paged do not correlate. I would like to have EVERY page in the old site redirected to the index.html in the new site. I tried options as found here, but so far I failed to have it work. Apprecciate your help.
Thanks a lot!
JC
Ignite! » Using the 301 Redirect for Search Engine Optimization said,
July 22, 2007 @ 10:33 pm
[…] http://www.stevenhargrove.com/redirect-web-pages […]
Daniel Ciomek said,
July 21, 2007 @ 11:10 pm
Hi Steve,
for the htaccess redirect, if you reorganized the whole site, and don’t remember all the older filenames, can you just use a “redirect all”, such as
redirect 301 *.* http://www.newdomain.com (for all pages)
or maybe
redirect 301 /old1/*.* http://www.newdomain.com/new1/
redirect 301 /old2/*.* http://www.newdomain.com/new2/ etc.?
Would that work? Obviously you would point some targeted traffic to some more generic pages that way, but would it work? Also, is this a temorary setting (couple of month?), or do you have to leave it this way for eternaty?
wings said,
July 21, 2007 @ 5:11 pm
i have bought a webdomain : mydomain.com and i wanted to redirect it to olddomain.com. but the service provider told me i cant and for that i should pay $5.5/month more to upgrade to web forwarding scheme. It seems not fare. Im wondering, if your webdomain do not redirect, so for what do they sell them without forwarding option? is there any other services so that i could be provided with webforwarding easily, or can i do any thing else for that? Answers are most welcomed.
Steven Hargrove said,
July 19, 2007 @ 9:02 am
Dave Fury,
Myspace only allows you access to the HTML of the page. There is no way of executing a 301 redirect on a myspace page.
Dave Fury said,
July 18, 2007 @ 11:48 pm
What method can I use to redirect one myspace page to another?
Thor Berntsson said,
July 14, 2007 @ 1:46 pm
Is this relevant for pages that I have already deleted or only for pages that I leave on the server with a redirect on it?
x3me said,
July 3, 2007 @ 4:10 pm
how about in my page at geocities? its only a free site so theres no php i only use pure html coding? any idea?
Bob THG said,
July 3, 2007 @ 2:51 pm
Howdy Steven.
I have a few pages that are deleted and gone.
I have cached pages of these files that still show up.
You say you don’t do a redirect with an HTML page.
How do I redirect to the new ones if the old ones are gone and it’s HTML?
All these 404’s can’t be good for page ranking and indexing.
Is robots.txt of any use?
Also my site is on a Linex box.
Thanks for your time and efforts - Bob
TBird said,
July 1, 2007 @ 5:49 pm
Your rewrite 301 information helped me a great deal.
Here’s a tip you may wish to add to your site:
If the directory AND the filename are changing you will need TWO redirects. First for the directory, then the second one for the file
Example:
redirect 301 /wrong_dir/ http://www.mysite.com/right_dir/
redirect 301 /right_dir/wrong_file.html http://www.mysite.com/right_dir/right_file.html
Thanks again. -tbird
links for 2007-06-27 | Mansoor Nathani's Blog said,
June 26, 2007 @ 8:45 pm
[…] Steven Hargrove : How to redirect a web page, the smart way Over the past 4-6 years, use of meta tag refresh redirection has been abused for uses in relation to SPAM. The result of this and other scenarios of mis-uses of it, is that when using it, that page WILL be de-indexed from every search engine. (tags: apache htaccess) […]
snow said,
June 25, 2007 @ 5:26 pm
Hi, I have looked up how to do 301 redirect with PHP on several sites. There code looks pretty much the same as yours expect for “header( “Status: 301 Moved Permanently” );”.
What is this good for?
Isn’t header( “HTTP/1.1 301 Moved Permanently” ); enough?
Joe said,
June 24, 2007 @ 11:33 am
Hello:
Thanks alot!
But how can I make 301 redirect for the whole subdirectory to a new website?
I need to redirect permanently some of the subdirectory, e.g.
http://www.xyz.com/folder/ redirected to http://www.newsite.com
(files in /folder/ are index.html, faq.html, base.html and there are also subfolders here)
Thanks
Chris said,
June 23, 2007 @ 1:52 pm
Very helpful indeed!
The Greatest List Of Web Developer Resources | Self Made 20 Something said,
June 21, 2007 @ 11:46 am
[…] Smart ways to redirect a webpage […]
K-IntheHouse said,
June 19, 2007 @ 2:15 pm
Hi,
Great post. I have a question regarding 301 redirect and pagerank. I recently updated my sitemap.xml so that all the urls are without the www prefix and I submitted it to Google. Now, my PR is 1 without the prefix and PR is 3 with the prefix. Is there a benefit to trying to adhere to one way or the other and have the mod rewrite do the rest?
In my case, since my PR is higher with the prefix, I wonder if it is best to regenerate my Sitemap with the www and submit it again to Google. And have the mod rewrite put it place as well.
What are your thoughts on this?
nrgguxuhph said,
June 18, 2007 @ 9:25 pm
Hello! Good Site! Thanks you! bnkoieugxqgg
TORCH said,
June 16, 2007 @ 2:14 am
Thank you! This info just saved me a bunch of frustration trying to link my websites to my online forum! Great info man!
robert said,
June 14, 2007 @ 4:01 am
While your blog is for apache -
For those of you who use Iplanet here are some notes for you:
(these are being used on iplanet 6.1)
To set all redirects to report as 301
go to the /https/config
Edit the obj.conf file and add
Output fn=”set-variable” error=”301″ noaction=”true”
after the line
Now, any redirects you do in your obj.conf will be reported as 301’s.
Couple of other options you can use in the obj.conf:
Lets say you own domain zabix.com, then one day your site name was published in USA Today as zabex.com. Register zabex.com and update the DNS to point to your zabix.com web server.
Now you could create a new VS for zabex.com but why have a second configuration to manage.
In the obj.conf for zabix.com you can do this to redirect zabex.com to the correct domain.
NameTrans fn=”redirect” from=”/” url=”http://www.zabix.com/”
Now that is cool, you are doing all 301 redirects so your search engine rankings are good, you have a single web configuration that will answer for both zabix and zabex.
But what if a person typed in the incorrect published page with some uri path after the FQDN: i.e. http://www.zabex.com/buymenow The above will just put the requester back to the home page on zabix.com.
NameTrans fn=”redirect” from=”/” url-prefix=”http://www.zabix.com/”
NOTE: You would add this ABOVE the previous fix: the order is important, the uri=”*” MUST come AFTER uri=”??*”
This second redirect you will notice has a url-prefix= option, this code bit states, if you see a request for http://www.zabex.com/(any two characters plus any thing else) do a redirect replacing http://www.zabex.com with ww.zabix.com and keep the remainding uri.
For example: http://www.zabex.com/buymenow will become
http://www.zabix.com/buymenow
so your new obj.conf would look something like this now:
Output fn=”set-variable” error=”301″ noaction=”true”
NameTrans fn=”redirect” from=”/” url-prefix=”http://www.zabix.com/”
NameTrans fn=”redirect” from=”/” url=”http://www.zabix.com/”
AuthTrans fn=”match-browser” browser=”*MSIE*” ssl-unclean-shutdown=”true”
NameTrans fn=”ntrans-j2ee” name=”j2ee”
…rest of the config file…
With this configuration, you can answer for a different domain names without having to run a second (or more) virtual server(s). If the request is for the home page, serve the home page. If the request is for anything after the FQDN, preserve that while rewriting the FQDN portion. And for all redirects issue a 301 so we get the page ranking for zabex as if it were zabix.
Hope you enjoy
Robert
jimmy said,
June 9, 2007 @ 2:12 am
How do you redirect in python.
Takenaka said,
June 4, 2007 @ 2:45 am
Aloha Steven!
You are truly a webMASTER! I really appreciate your generous take on the KISs approach. As I move around the island (or sometimes out of state) I can rely on your simple code for redirection (no messing around with JS, etal.) and I don’t need to waste any space or code or brainpower (since mine is limited)!
Mahalo for your kokua,
CST
Tutoriales Zumbe » Redireccionar correctamente said,
June 2, 2007 @ 7:32 pm
[…] Fuente: http://www.stevenhargrove.com/redirect-web-pages/ […]
gregoryb said,
June 2, 2007 @ 11:08 am
Steven-
Thanks for the step-by-step and clear language. Your post was really helpful.
greg
Wayne said,
June 1, 2007 @ 1:10 am
My website uses frames. The search engines are directing viewers to pages within my web site. I would like to redirect them to my /index.html page when the search engine displays /home.html page I want to do this to all my pages.
What is the code that I use in .htaccess
Thanks
Wayne
Kell said,
May 28, 2007 @ 5:37 am
2 Questions please
1. What is the code “$1 [R=301,L]” for - can I leave this out ?
2. can I add all of the Mod_Rewrite code in the same htaccess file that has the following script in it
“Redirect 301 /old/old.html http://www.you.com/new.html ”
and what should this look like please ?
Thanks
Kell
301 redirect « vectorcowboy said,
May 24, 2007 @ 11:47 am
[…] 301 redirect 24 05 2007 So one of our big clients is moving all of their sites onto one domain. Which led to lots of digging about the best way to redirect visitors to the new location, while still preserving the search engine rankings. A 301 (permanent) redirect is definitely the best way to go. I went with an htaccess file. A simple line of code (Redirect 301 /old/old.html http://www.you.com/new.html), save it as “.htaccess”, upload it to the server and you’re set. This site has some pretty good info about this and other ways of doing redirects: http://www.stevenhargrove.com/redirect-web-pages/ […]
dekel said,
May 22, 2007 @ 8:28 pm
Hello,
How can I redirect more than 1 page?
not all the site, just 20 different pages?
dekel
Tarun said,
May 20, 2007 @ 4:40 pm
That is pretty good information. Thanks a ton !
Kind Regards,
Tarun
Vipin said,
May 17, 2007 @ 9:51 am
Hi,
I want to redirect a url using perl and the redirected url should be a new window.
This should be done using print command…
is that possible..
Spud said,
May 13, 2007 @ 8:03 pm
@Gary -
You literally need to create a file named “.htaccess”. Nothing before the “.” and nothing after the “htaccess”.
Most online page creation tools won’t allow for this file name. If so, you’ll need to create the file on your local computer and upload it to your site… if possible. I suppose it might be possible to create a file named “.htaccess.”, make the necessary code changes, save it and then rename it to just “.htaccess”. However, you might just be right back to the fact that most online page creation tools won’t allow for this file name.
Good luck,
Spud
Gary said,
May 13, 2007 @ 5:42 pm
Steven
Thanks for the redirect info! I am trying to follow your 301 Redirect Using htaccess but an lost on one very very simple point…..you say to create a file “.htaccess”. However, my web host doesn’t allow me to create such a file name. Do you mean pagename.htaccess or literally a file called .htaccess.html? Forgive me if this is a stupid question, pure amateur here!
Jeff Miller said,
April 27, 2007 @ 3:19 pm
Thank you! I used the .htaccess method and it works perfectly.
Always nice to try something and have it work the first time.
—jeff
Inventive Design | Väärin kirjoitetut hakutermit tuovat kävijöitä - Haukoneoptimointi said,
April 27, 2007 @ 5:02 am
[…] Oikeastaan olisi järkevää kirjoittaa kaikista noista väärin kirjoitetuista hakukomeptimointi sanoista oma sivunsa, ja ohjata kaikki liikenne samalla sivulle esimerkiksi 301 redirectillä. […]
Jeremy said,
April 26, 2007 @ 5:58 pm
Thanks! This page was totally helpful to me when I had to deal with IIS to make a redirect. Great page!
floffy said,
April 24, 2007 @ 10:16 pm
I want to redir a port to mount to a url
like this > http://test.com:8080
and i want it > http://test.com/webmail
could that possible ? in windows apache
Coder Journal : World Of HTTP/1.1 Status Codes said,
April 24, 2007 @ 2:28 pm
[…] perform these redirects, that I have talked about above, in your favorite language please read this article from Steven […]
Atul said,
April 19, 2007 @ 5:25 am
Wonderful port
test 04/15/2007 « Strange Kite said,
April 15, 2007 @ 1:57 pm
[…] Steven Hargrove : How to redirect a web page, the smart way Annotated The best way to redirect those pages is by using something called a […]
My daily readings 04/15/2007 « Strange Kite said,
April 15, 2007 @ 7:49 am
[…] daily readings 04/15/2007 Steven Hargrove : How to redirect a web page, the smart way Annotated The best way to redirect those pages is by using something called a […]
RIBS: Rhythms In Black Satin » Track 50 Soul Music Sites All On One Page… said,
April 12, 2007 @ 1:01 pm
[…] a 301 redirect to the default page of the new subdomain to display the […]
More Light! More Light! » Blog Archive » Eric Newman: How to ask for help on the web, the bad way said,
April 11, 2007 @ 11:15 pm
[…] Steven Hargrove: How to redirect a web page, the smart way: “and i know the source is correct because it gave me a source to use and it looks right to me i know this program works because i see other web pages work and it specified that windows xp can work which that is what im using (professional)and i talk with other people and they have no idea on this and i have one more question what is redirect web page mean im makeing pages from a web program called “web page maker v2″ i put the source to use the program after i create the page and i know i told where to look for it to” […]
Coder Journal : A Guide To Proper URL Construction said,
April 10, 2007 @ 1:19 pm
[…] Search Engine Ranking, specifically PageRank is calculated per-URL. So the best idea is to do a 301 Redirect for the different patterns I listed above. In my case of Coder Journal I have URLs 2,3,4 all […]
NetInfoWeb 2.0: Soul, R&B, Jazz and Blues on the ‘Net » How To Track 50 Soul Music Websites All On One Page… said,
April 10, 2007 @ 6:22 am
[…] a 301 redirect to the default page of the new subdomain to display the […]
Rick said,
April 4, 2007 @ 8:50 am
The Redirect directive maps an old URL into a new one. The new URL is returned to the client which attempts to fetch it again with the new address.”
I only just discovered today how easy, useful and effective .htaccess Redirects are. Here is the code in its purist form:
Redirect file.html http://your.url/file2.html
I have a few pages that I only wanted to be available through a secure connection, https. However, I needed a fail-safe just incase someone visited the URL on the non-secure server, http. This is where .htaccess comes in.
snake said,
April 3, 2007 @ 7:08 am
hello
i have my website in a server , and my downlods files as ( zip , rar vides ) in free server account subdomain @netfirms so how can i mask the url of downlaods file so it’ll apear from my 1st site not the subdomain in pages and download manger
Regards
Snake
jeeradate said,
March 31, 2007 @ 3:54 am
I host my web site at Godaddy.com, I install Dotnetnuke CMS in sup directory. And use HTML meta tag to redirect the user to the sub directory. I know that it should not do so as your comment.
So far I can host only one domain name. But I have multiple domain names but I don’t know how to redirect user to appropriate directory according to the domain name.
Would you please be so kind and advice?
megha said,
March 29, 2007 @ 4:26 pm
hi,
i need a urgent solution to use the redirect script.creativemeg.com is my domain which is working at this moment.I have booked one more domian called exaltservices.com.Now i want to redirect the creativemeg.com/exaltservices/index.html
can you help me out.
Actualización sobre subdominios en Google said,
March 28, 2007 @ 7:09 am
[…] el sitio de Steven Hargrove tienes un ejemplo de cómo hacer redirecciones en varios lenguajes de programación. Además, no está de más recordar cómo hacerlo con la herramienta para webmasters de […]
Cape Cod SEO - Maintaining the Sex Appeal of Your Web Addresses said,
March 27, 2007 @ 12:24 pm
[…] How to Redirect a Web Page, The Smart Way […]
sam said,
March 27, 2007 @ 6:33 am
Tried doing a 301 redirection using a .htaccess file, saved it to the root directory, put in the right code, checked the page, and… nothing. I hear sometimes .htaccess files are not supported by the server (such as Microsoft IIS 6.0 web servers), the page is written in html so does that mean i cant use the other language codes? any other way of redirecting?
Marc said,
March 23, 2007 @ 11:26 am
Is it safe to purchase a domain that has a relevent title and not develop that domain and merely redirect it to one that is developed and very strong from an SEO standpoint? Will the developed site be penalized because of this? I have always been hazy on whether this was ok or not?
Dav said,
March 23, 2007 @ 1:16 am
Steven,
As of writing this, Go Daddy (free) allows to choose between 301 (perm move) or 302 (temp move) but Network Solutions ($) doesn’t give the choice.
Until my new site gets up in the search engines, I’ll use the technique on this page.
Thanks again!
Dav
Dav said,
March 23, 2007 @ 1:07 am
Steven,
Great! Thanks!
Dav
Steven Hargrove said,
March 22, 2007 @ 4:27 pm
Jack,
A framed redirect is an html page redirection, except its inside a frame. that is a bad idea!
Jack Lewis said,
March 22, 2007 @ 12:34 pm
Hello Mr. Hargrove,
I bought an account with 1and1.com to host my online site, “DreamVistaTravel.com,” but had some cgi_bin trouble. Instead of spending time figuring it out, my programmer was very familiar with setting up accounts with BlueHost and suggested we get another site in the mean time, “WorldVistaTravel.com.” So I got it and hosted it with BlueHost.com. I would like to redirect my DreamVistaTravel.com to WorldVistaTravel.com (BlueHost.com). When I went to do this with 1and1.com, I found that they offer two options: HTML Redirect and Frame Redirect. Trying to figure out the difference brought me to your site. Outstanding article. Now I know not to use the HTML Redirect and went with Frame Redirect; however, I still do not really get what a Frame Redirect is or what are the advantages and disadvantages. I see that it allows for: Title, Metadescription, Keywords.
Is there any advice oor information you could share with me on this?
Thanks - Jack
Steven Hargrove said,
March 22, 2007 @ 9:27 am
Dav,
I believe that most registrars domain forwarding features use the 301 redirect in the process, but I am pretty sure that some use the 302 redirection method as well. Both are safe as far as I know, but remember the 302 redirect is titled “Temporary”, so their not the same.
I wouldn’t go as far as getting a site hosted simply to have it redirected, I have no reason to believe that using your registrar to accomplish this would have any different effect.
However, the disadvantage of using your domain registrar to redirect is that you can only set 1 area of redirection, meaning not only will the home page of your old domain be redirected to the new domain, but every sub-page of your old domain will also redirect to the same location of your new domain.
My advice: If you don’t mind having every page that access is attempted on your old domain redirect to the same URL on the new domain, then use your registrar. Otherwise if you want more in-depth and per-page redirection, then use your server that your old domain is hosted on to accomplish this.
Dav said,
March 22, 2007 @ 1:18 am
Steven,
Great info!
What is better for redirecting a site, in regards to search engine ranking?
Doing it like this:
Response.Status = “301 Moved Permanently”;
Response.AddHeader(”Location”,”http://www.new-url.com/”);
OR
Have a domain registrar (i.e. network solutions, go daddy, etc…) forward the old domain name to the new domain name (site).
Thanks!
Bijoux said,
March 21, 2007 @ 10:34 pm
Hello Steve,
I have been testing your advice about this. However, it seems that I have no luck.I made sure I followed the direction correctly, codes and file name. But when visiting the pages I wanted to redirect it doesn’t work. I am receiving E404. The server is Apache.
Don said,
March 21, 2007 @ 3:31 pm
Thanks, Steve!
After receiving no help from my clients web hosting company tech support on the issue of redirects I figured, “OK, I will experiment and see if this techie wannabee brings down all of your servers” .
Amazing how they would not give me any information until I asked if they were using a Unix server for my client. “Why….yes we are.” Then I asked what software. “It’’s Apache.”
So I use your 301 code and upload it and it works perfect.
Oh, and did I mention this afternoon my client and I are visiting the new company that we are moving both of his domaiins to. The one with the friendly tech support.
Daniele said,
March 21, 2007 @ 5:47 am
Ok, thank you very much then.
Bye Steven, i’ll read you!
STRAIGHTALK WEB SERVICE said,
March 20, 2007 @ 11:42 pm
I was just looking for a visual example of how a redirect was done, my hosting provides me with all these slick gadets as I call them, but i was tring to show my viewers a point about having webpages going to ‘404′ and how crucial but simple this matter can really be for any website Owner. Your article was of much help and if You had a rating I most certain to give this article an A+ ( 100 points)
Thanks and keep up the good work.
Webmaster at straightalk web services
Steven Hargrove said,
March 20, 2007 @ 7:28 am
Yes, a link to the new page without any redirection should suffice safely. Just be sure to not have the same content on two pages, meaning you will want to remove all of the old pages on your old domain to avoid a duplicate content filter in the search engines.
Daniele said,
March 20, 2007 @ 6:54 am
First of all, thanks for the quick answer… i didn’t count on it, with this being an old article and all.
And sadly, the situation is that. It’s a webspace that my client got with his ADSL line, so it’s crappy standard stuff… e-mail, third-level domain with 20Mb space, and NO server-side languages at all. More or less an FTP space… That is one of the reasons i’m moving the site to a better hosting (together with more Mbs required). The new location will have server-side stuff, databases, and all those nice gadgets… that i’d have needed in the old location to have a working redir
I’ve arrived here searching for redirect methods, but as i see server help is needed anyway… i think I’ll just have to go with the old-fashioned “the site has moved” page. A link is all a spider should need to find the new site from the old location, right?
Steven Hargrove said,
March 19, 2007 @ 4:14 pm
Daniele,
I am curious if the new server location you mention really does not have any server-side service to handle htaccess or some kind of server side scripting language. This seems odd, I would verify this and if it is true, I would see about installing htaccess capability onto this new server, it would be your best friend in some cases!
On the other hand, if what you say is true and you cannot have access to any of the methods above, the other option I would suggest in this case is yes, having a page mentioning that “this page has been moved” and have a link pointing to the new page, perhaps have thge link titled something to the effect of the topic of content of the new page. However more importantly, is having the link there and not using any sort of client-side auto-redirection, thats a no-no!
Daniele said,
March 19, 2007 @ 7:52 am
I was pondering to move the site of one of my clients from a ISP-related, third level domain to a second level to have more features, space etc. But now i’m stuck, since i read meta, javascript or Flash redirects are better not used… Then if someone has, like me, a plain FTP space, with just a name and no other language running, has to end up using just the classic page saying “Sorry, the site has moved to XYZ” ..? There is no other method?
Steven Hargrove said,
March 12, 2007 @ 10:25 am
Thanks for pointing that out, Sy. I have corrected it.
Sy said,
March 9, 2007 @ 4:51 pm
The ruby on rails example shouldn’t have the fancy quotes in it and should use regular double-quotes.
Ken Dyck said,
March 4, 2007 @ 9:33 am
Thanks for the tip, Steve. Works like a charm.
Jim B said,
March 3, 2007 @ 4:26 pm
Hello Steve,
Excellent information!
I have a different situation that I need to forward to an eStore that does not have meta tags for search engines. I was recomended to use a redirect with meta tags and description. I was going to do this in html but as you suggested that is a no no.
using index.php or htaccess, is it possible to write the redirect with meta tags and description of web site. Can you please help and advise on a sample code.
Thank you,
Jim B.
Bobbie Dennis said,
March 2, 2007 @ 12:57 pm
Hi there,
I am writing to you as a non-techie webmaster of a local government website. We use javascript for our redirects, which are used partly for departments to have a user-friendly URL to give out, e.g., http://cityofchesapeake.net/parks. Using the javascript rather than meta refresh enabled users to use the BACK button to get back to the homepage. However, looking for a better solution, I came across your site and this page about 301 redirects. We do not use ASP, PHP, JAVA, etc., but do have Apache.
I was interested in trying the .htaccess, but have never worked with a .htacess file before. I have a couple of questions:
1) In creating the page, do you have any other coding such as your tags or anything like that? If so, where do you put the 301 redirect coding?
2) When you create the .htaccess file do you give ia name such as parks.htaccess, or is it just .htaccess?
3) Can you put only one line of code for one redirect, or could you have several 301 redirects listed in this one .htaccess page?
As you can see I am a novice, although I have evolved enough with 10 years of working on our site to keep it going!
Steve, thanks so much for any help that you have time to provide.
Bobbie Dennis
Webmaster
City of Chesapeake, VA
(757) 382-8419
Kay said,
March 2, 2007 @ 6:55 am
Have a query. Consider I have a domain (+server space), say http://www.abc.com. I run a blog in this, in a subdomain, called http://www.abc.com/alphablog. Alphablog gets real popular and I book the domain http://www.alphablog.com to get better mileage out of it and not let it tag as a subdomain anymore.
But, here’s the issue. Since I’ve 2GB server space in abc.com, I only book the domain URL alphablog.com and it does not have its own server space. I set up forwarding at alphablog.com domain control panel to reach ww.abc.com/alphablog. Perfect, up to this point.
Is there a way I can change the address bar URL to http://www.aplhablog.com, even when people type in http://www.abc.com/alphablog - this is very likely since the blog has been known to have this URL till now. But, to inform people that while the site has not moved, the URL is now easier and direct, I would like to get this change done. Is that possible?
Please help.
Kay
Reed said,
March 1, 2007 @ 2:47 pm
Hi Steven-
How big can (should) the .htaccess file be? I have a site with a lot of old urls that I need to be redirected to the new url with little in common in the structure of the url. Should I just add a line of code in the .htaccess for each file? I have about 300 files that need to be redirected. Thanks for your help this is a great article!
-Reed
arpi said,
February 23, 2007 @ 5:23 am
hello,
i have to make a sit in php and in it i want to redirect a page,in which when i click one hyperlink all data through that hyperlink should be dispayed and old data i dnt need it..
how can i do it?
waiting for the reply!!!!
Veign said,
February 10, 2007 @ 1:44 pm
In case anyone wants to test what the headers look like to ensure a 301 redirect is coming back check out:
http://pageheaders.com
zoky said,
January 30, 2007 @ 6:15 pm
Great, I use it to redirect my old page, just I don’t understand do I have to redirect each subpage to new one…
Rich Harlos said,
January 26, 2007 @ 6:33 pm
Thanks for the 301 tip… I used the simple 301 redirect in the very first example you gave and it works flawlessly!
Wasn’t sure if I actually had to create the “from” page first and it turns out that I didn’t, which was interesting.
Anyway, appreciate your sharing this
Miroslav said,
January 9, 2007 @ 12:11 pm
UH! Must point out that the page in question is not Meta tag redirect type and not required to be indexed in any serch engine. This redirection ..HUM! lets say hypotheticaly is used to do redirection to a place where business deals with CRM or ERP etc.
TA!
Miroslav said,
January 9, 2007 @ 12:02 pm
Hi Steven
Whatif you do not want anyone to be able to view the code in that redirect page?
For example, a webpage of the club I enjoy:
If you go to http://www.bmovieclub.co.uk/ page source you will see that the website is in fact at
http://www.playbat.org/bmovie/.
How do you make imposible for visitors to view web page code and find where the pages are actualy hosted?
Thanks in advance
Repply’s to my email THANKS!
Total Physique Online » Blog Archive » links for 2007-01-09 said,
January 9, 2007 @ 12:53 am
[…] Steven Hargrove: How to redirect a web page, the smart way (tags: redirect howto web WebDesign htaccess webdev apache) […]
Tim said,
January 8, 2007 @ 1:42 am
I am using Wordpress by the way.
Tim said,
January 8, 2007 @ 1:35 am
Steve my problem is compounded by the fact that my bad URL was removed. It does not exist in order for me to add a PHP script to it
Julie said,
January 7, 2007 @ 4:37 pm
Dear Steven,
I upgraded my static html site to a dynamic site build with .NET (aspx pages). The problem is that all my html pages are indexed by google and the new pages, which will replace the old ones, aren’t indexed at all.
Do I need to redirect all my old html pages to the new aspx pages?
I want to use also the example you wrote above, what if I have more than one page?
Thanks,
Julie
Mister PC said,
January 4, 2007 @ 8:03 pm
I needed a redirect for my weblog and its php and I don’t have a lot of experience with php yet.
Thank you very much for your easy to follow directions,
Regards,
Mister PC
http://misterpcusa.com/
Steven Hargrove said,
January 4, 2007 @ 11:41 am
AdsBay:
When you use htaccess (not to be confused with mod_rewrite) to redirect a page, it checks for that literal file name, and since “custompage.php?id=4″ is not an actual file name, that will not work.
What you will want to do is use the PHP method to accomplish you’re redirect:
PHP:
// place generally near the top of you’re “custompage.php” PHP document
< ?php
if($id == 4){
header( "HTTP/1.1 301 Moved Permanently" );
header( "Status: 301 Moved Permanently" );
header( "Location: http://www.adsbay.co.uk/tools.php” );
exit(0); // This is Optional but suggested, to avoid any accidental output
}
?>
Alex said,
January 3, 2007 @ 5:26 am
Hello, I have been trying to use the redirect with the .htaccess file and nothing seems to happen. I followed all the steps. When I try to open the file on the browser I get the following message: [an error occurred while processing this directive] You don’t have permission to access the requested object. It is either read-protected or not readable by the server. [an error occurred while processing this directive]
Could you help please?
Regards
AdsBay said,
January 1, 2007 @ 6:30 pm
Hi
I am trying to redirect a dynamic page to a startic one. the code i am using is bellow but it does not work, could you please let me know what is wrong with it.
Redirect 301 /custompage.php?id=4 http://www.adsbay.co.uk/tools.php
Thanks!
Redirects and SEO | SearchGrit said,
December 30, 2006 @ 2:37 pm
[…] The first thing you want to do is check out this great page on how to do redirects in various web environments. It describes the technical details for setting up a redirect using various programming languages under different web environments. The article though is a little light on when to use a redirect so I’m going to cover that here. […]
Bertie said,
December 22, 2006 @ 6:06 pm
Hi Steven,
very good instructions indeed, thanks for all the work you’ve done. If I can ask a question as I am new to these Webmaster tools: I’ve done the 301 redirection and that worked fine but the html pages show a 404 Not-found error when I click on them. Do I need to put up a 404 error page in my new domain or do I have to use Google’s Automatic URL Removal System to remove all my pages from my old domain?
Regards,
Bertie
Al said,
December 21, 2006 @ 2:30 pm
Hi,
I am trying to redirect /somefolder 404 to users/somefolder using .htaccess
How can I do that?
Please help.
Bravo said,
December 21, 2006 @ 3:35 am
Can you suggest a solution to the following problem.
External link on my website >>> visitors click the link >>> a new window opens >>>the website loads in the mean while the cookie is downloaded into the visitors website >>> after say 30 seconds the visitor is redirected to another page on the same website
R. Adams said,
December 18, 2006 @ 2:01 pm
Hi,
Is there a way to obtain a list of all redirected directories on an IIS server?
Thanks in advance,
R.
Oli said,
December 16, 2006 @ 7:56 am
My host has an apache server, and I’ve replaced the .htaccess file with:
Redirect 301 /olifreke.co.uk/index.html http://www.cassette-music.co.uk/
But it doesn’t work?
I’ve tried all manner of variations on the theme, but it ain’t happening? Have I made some kind of elementary mistake?
thanks in advance…Oli
Gary D said,
December 13, 2006 @ 2:57 am
Is there a way - using your first .htaccess method - to add a message to flag the change of address to the user? i.e. “This page has moved…” Or do you believe that’s bad style?
Thank you
Blair Trottier said,
December 12, 2006 @ 1:43 pm
Hey Steven,
I’ve been bashing my head over this redirect problem for a couple of weeks now..my web site is is hosted in a “Shared” windows environment (I don’t have access to the IIS control panel). I have about 300 .html pages I want to change to .shtml so I can use SSI. Most of them are index by google and other search engines so I need to do some sort of 301 redirect to the corresponding .shtml file. Everything I’ve read so far about doing this assumes your existing files are .asp or hosted on a UNIX server (htaccess) or have access ot the IIS control panel to redirect the pages that way. I want to do this the right way (not using a meta refresh redirect)..
HELP!
/Blair
Steven Hargrove said,
December 12, 2006 @ 11:42 am
Kitty, in htaccess a space counts as a value separation, try replacing the spaces in your URLS with “%20″ when referencing them
Gary said,
December 11, 2006 @ 6:39 pm
Hi,
I have about 30 pages that we removedabout a year ago as they were to similar to each other. These pages still have links to them and I was wondering how I could use IIS to re-direct requests for these pages to a current uRL. Please bear in mind that these pages no longer exist on the server. If they did I would use IIS to 301 them.
Kitty said,
December 10, 2006 @ 8:46 pm
I have a client who used spaces in filenames instead of underscores. Is there a way to 301 redirect these pages without causing a 500 Internal Server Error to occur.
The instant I try to add the redirect of the filenames with spaces as stated above, the whole website malfunctions and I get the 500 errors on many of the pages.
Any help is appreciated - Thanks!
Flyttning av Permalnkar - Rudolf.nu - vare sig du gillar det eller inte! said,
December 8, 2006 @ 7:41 pm
[…] How to redirect a web page, the smart way Han skriver om olika lsningar fr redirect, bde via .htaccess filen, perl, php mm. Med en vldigt bra guide ocks! […]
Mark Jeghers said,
December 4, 2006 @ 7:39 pm
Is this Apache-specific? I am seeking a solution for use in thttpd
where we need to redirect an “http://….” URL to an “https://…” URL
(e.g. it is always ending up with a secure connection)
Thanks,
/Mark
DR Confuscious said,
December 2, 2006 @ 8:00 pm
well, i didnt REALLY learn anything ‘new’ here - heh. * grunt laughs and adjusts nerd glasses *
John said,
December 2, 2006 @ 12:41 am
Hi Steven,
I hope you could help me. I appreciate a lot.
When I click on serch engin results, they will be redirected to other sites for the first two click. Also sometimes even the URL address showing in address bar is correct but the content is something else.
Thank you very much
John
Drew said,
November 25, 2006 @ 2:51 pm
Steven,
Thanks so much for a great article. My site dropped off Google shortly after I converted my index.html to .php and put in an HTML redirect. I’m not a programmer, but I was able to make the 301 redirect work the first time. I found your article on digg, looks like a bunch of other folks did too.
Thanks.
vendude said,
November 21, 2006 @ 10:15 am
Please help us Obi Wan. You’re our only hope.
We mapped a http://www.domain.com to our Typepad blog at domain.typepad.com a few months ago. With our ignorance of the way of Google, we thought it was a good idea to get our brand and have two ways to get to the site. Now our links are split, so there is no going back…and all of a sudden, though our traffic has never been higher and we’ve never had so many good links from others, our google ranks and inclusions are dropping.
TypePad doesn’t allow htaccess
I am not the most technical, but i don’t think we can use your other 301 techniques either.
Got any more? Anything we can signal a 301 with in the headers or something?
Anyone out there have a way to do the redirect at Typepad and keep the business you’ve built? this is a MAJOR failing of Google
Is there a way to send message to Google that we would 301 redirect if we could. (one look at our site and it’s clearly not a splog)
Would you do a meta redirect on the page rather than do nothing?
Any insight ?
This is urgent as we watch our Google rank and inclusion drop over days…yours seems the most complete resource to be had but i can find nothing on Typepad and domain mapping.
Thanks for your help and for any help your readers might be generous enough to share.
I’m going to post on Matt Cutt’s as well fyi as he had a post on this.
thanks.
Konstantinos said,
November 20, 2006 @ 5:22 pm
Steven, thank you for an excellent HOWTO. I would like to ask a question:
Similar to the PHP/ASP/etc. methods, is there a code I can write in an XML file so as to have it redirect to somewhere else? I’m on a Windows server with limited access and want to redirect the site’s feed to the new feed.
Thanks in advance for your help.
Sabu said,
November 20, 2006 @ 1:29 pm
The 301 redirect method that you have described seems like not useful with geocities. I tried .htaccess but the file can not be uploaded. Then I used ASP .NET and JSP/JAVA scripts, unfortuneately there is no redirection occured. Please comment…
Thanks
Sabu
Luc Dubois said,
November 14, 2006 @ 8:30 am
This was one of the most informative pages I’ve read on the subject this week (and I’ve been reading hundreds of pages…), not only the original posters article, but also the wealth of ideas and information in the comments! Apparently there is a lot of interest in the topic, the comments run from April to now! Congrats Steven!
Steven Hargrove said,
November 10, 2006 @ 6:57 pm
Kenny B,
Yes you surely can, with mod_rewrite, you can see it in the “mod_rewrite” section of this article.
Example:
In this case, the (.*) registered the wildcard, and the “$1″ executes the value of it
Kenny B said,
November 10, 2006 @ 1:58 pm
Steve,
One last question. Can we use wlidcards to reference all of the 300 product pages in the old site?
Example:
Redirect 301 /old/*.html http://www.you.com/default.html
That would save tons of time….
Steven Hargrove said,
November 10, 2006 @ 10:54 am
KennyB:
Does the server of the site in question allow htaccess? If so, it would probably be the best way to go about it
in your.htaccess file, it would be as easy as something like this:
Basically you would do this for every page, for example if you had 3 pages that needed to be redirected:
Or, if the pages in question were dynamic in some way (php, asp, query string-related URL?), you could set up that same file name (ex: if the page was in php, create the php page and just add the PHP 301 redirect code)
Hope that helps!
LHJackson :
I can’t speak for the search engines, but I will say that using 301 redirects as your prime method of page redirection has been pretty much adopted as a standard. As far as I know, it is by far the safest and most reliable way of redirecting web pages
My advice: Don’t be afraid of the 301 redirect unless your intentions are Black-hat SEO.
Kenny B said,
November 9, 2006 @ 5:08 pm
Steve,
I have taken quite a bit of time reading through your forum here and I’m very impressed, but I must be missing something. All that I have read seems to be based on the same valuable assumption: that the developer has access to the previous web. I can’t add redirect code to a page that is no longer accessible.
Client’s dilemma -
Our client hated his old site so much that he called up his “tech hosting guy” and told him to cancel everything without considering the consequences. He’s loves the new site (”skipsboots.com”), but now that the new site is live, he’s realizing that all of the google and yahoo search engine listings no longer work (”404 Page cannot be displayed”) because nearly all of them link to pages from his old site that no longer exists.
Our Dilemma -
He has challenged us to figure out a way to salvage his rankings and listings by having all the old links redirect to his new site. The problem is we no longer have access to the old site. The pages are gone and the web has been deleted by his old developer/host that he fired. The only common bond between the two sites is the root domain(”skipsboots.com”). Once you get into the web structure, everything changes beyond that. We are not tryng to map products and pages to the new site, we would be perfectly content to redirect them all to the home page and let the customer browse from there since his product line and content is much different now.
Any ideas?
p.s. We trap 404 codes for our URL rewrite logic that directs and creates the custom pages for each category and product in the shopping cart.
LHJackson said,
November 9, 2006 @ 5:07 pm
Hi Steve,
We have several clients who are launching new Web sites - they want to redirect their old optimized Web sites to the new Web pages w/o compromising their existing page rank or rankings. Can a 301 guarantee the preservation of rankings?
In the past we’ve used 10 second redirects on the old site to allow the new URLS to be indexed and garner rankings in the engines, but from what I am reading, this might not be the most effective method for preserving rankings - can you please advise?
Thank you -
Leslie
Kishor said,
November 8, 2006 @ 3:20 am
Thanks and i found its a amazing information out here. keep it upp.
Lakisha said,
November 7, 2006 @ 11:26 pm
Hi Steve,
I am trying to go to http://www.macys.com, and it keeps re-directing me somewhere else. It keeps saying page not found, but 2 days ago I opened it up and now it won’t let me go there.
Terje said,
November 7, 2006 @ 2:09 pm
Thank you for the decent tutorial.
While you seem to leave no room for misunderstanding, I want to make sure if 301 will help in my case. I have a splash(only language selection) page and need to remove it now. But the new index.htm page is located on /en subdirectory.
.htaccess
Redirect 301 /index.htm /en/index.htm
Would this do the job, causing no problem with Google?
Thank you.
Steven Hargrove said,
November 6, 2006 @ 10:26 am
yes it should work just fine, because its conditioning its statements via the domain name (ex: rewritecond %{http_host} ^shop-batteries.com)
htpbbs said,
November 5, 2006 @ 9:52 pm
thanks, this is the most detailed 301 manual
but if 2 (old and new) domains have bounded to the same hosting directory, does the above setting still work?
Steven Hargrove said,
November 2, 2006 @ 11:22 am
ivan, try this:
———————————————————————–
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^shop-batteries.com
rewriteRule (.*) http://www.shop-batteries.com/
rewriteRule ^index.htm(.*) http://www.shop-batteries.com/1
———————————————————————–
Hope that helps!
ivan said,
October 31, 2006 @ 10:02 pm
Steve ,this 301 redirect is very useful to me, I have a site which has bean indexed three index pages by google ,you can “site:shop-batteries.com” in google.
(1) http://shop-batteries.com
(2)http://www.shop-batteries.com
(3)http://www.shop-batteries.com/index.htm
So I must redirect the page (1) and (3) to page(2),I use the method of creating a .htaccess file,the content of the .htaccess is following:
———————————————————————–
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^shop-batteries.com [nc]
rewriterule ^(.*)$ http://www.shop-batteries.com/1 [r=301,nc]
redirect 301 /index.htm http://www.shop-batteries.com/
—————————————————————————————–
But this code can only direct all non-www traffic to www, it couldn’t redirect /index.htm to http://www.shop-batteries.com
What is wrong? Thank You!
beg you reply!
Ivan
drew said,
October 30, 2006 @ 1:41 pm
Steve - your standard 301 redirect did the trick for me - many, many thanks!
» How To: Redirect a web page, the smart way… said,
October 26, 2006 @ 11:59 pm
[…] Page Summary: But what if you want to get rid of those old pages without having to worry about those who go to the old web page and see nothing. Very useful, especially when changing hosts to changing domain names. Most sites that I have seen that use flash to redirect a page, they seem to assume that search engines wont notice, but trust me that could not be further from the truth. How about using Google and getting answers to your questions.read more | digg story […]
Pete said,
October 22, 2006 @ 12:23 am
Looking for web program which is basicaly a web site which allows me to get a DOS window and launch a telnet session with some of my cisco devices I need to manage. I have a firewall at work which only allows port 80, and 443. I have an IIS web server. I need a program wich will allow me to logon to the web server via port 80 and then allow me to launch a telnet or ssh session via that web site or software. Thanks for your help.
Design Enterprise » Blog Archive » Bags of goodies said,
October 16, 2006 @ 10:46 pm
[…] Redirect Using the 301 Method, not META refresh Steven Hargrove put up a really cool and detailed article how you can keep and maintain your user coming back to your site without having the search engine banning you for using the old school HTML redirect through META-refresh, but using the 301 Redirect. Worth a read. […]
rukh.de said,
October 13, 2006 @ 6:17 am
How-To Redirect Web Pages The Smart Way
Stumbled over this website from Steven Hargrove explaining how to redirect a web page the smart way. From simple HTML to a multitude of different languages used to create web pages. This is one of the best explanations of the HTTP 301 handling.
…
Ruby on Rails said,
September 29, 2006 @ 4:06 pm
Excellent explanation of how to do 301 handling
Steven Hargrove said,
September 29, 2006 @ 10:26 am
Hey Joel!
Does it redirect the page at all when you place that htaccess code?
If it does, then whats what you want. The transferring of the Pagerank happens over time after the new site’s structure is cached in google and after google’s next pagerank update. Any backlinks you have to your home page would then be transferred to the destination web page.
Hope that helps.
joel said,
September 28, 2006 @ 11:41 am
Hey Steve,
I tried both htaccess and the php method and neither redirect the Google page rank. What am I doing wrong?? Here is the htaccess file text (removed now)
Redirect 301 /index.php http://www.neighborhood.com/realestate
Thanks again Steve!
Joel
grant said,
September 14, 2006 @ 9:04 am
I get a 500 error when I add the above code to my .htaccess file. any ideas? thanks.
Tech Industry » How To: Redirect a web page, the smart way… said,
September 12, 2006 @ 5:15 am
[…] The internet today is full of webmasters that are always updating, editing, changing and even deleting web pages. If people are finding your old pages when querying in these search engines, and they attempt to go to that page that has been deleted or moved, they will get a “404 File Not Found” Error! Now no webmaster wants that!read more | digg story […]
Jahangir said,
September 9, 2006 @ 3:39 pm
Hello,
How can i redirect a site from http to https
Thanks.
Brian said,
September 8, 2006 @ 6:23 am
Hi,
I want a flash site with basic info. I also have several other web address that when accessed from a search engine- go to my new flash site. Will I be penalized for this? And how is the best way to do this?
Thanks!
Benno Moiseiwitsch said,
September 6, 2006 @ 5:36 am
Hi Steven, I have a number of old links I need to redirect. I want to redirect the old pages to one of a variety of new pages on my site. Is there any chance you could be so kind as to let me know what the htaccess file would look like to manage this process of multiple redirects? Thanks in advance, Ben.
Jack said,
September 2, 2006 @ 12:43 pm
I’m afraid that what I want might not be possible, unless with a lot of work, but here’s my problem:
I rebuild a site for a customer. Formerly it was made with dreamweaver and the content of the site was placed in a folder called /html. In this folder there were many subfolders containing a lot of different html files.
I rebuild it using wordpress and now the content of the site is in /site with a normal wordpress structure of the folders.
What I actually need is some kind of redirect that makes ANY call to ANY file or (sub)folder within/underneath /html to go to /site/index.php.
Can this be done?
Michael said,
September 1, 2006 @ 4:18 pm
I took the htacess option and everything went well.
Thanks!
Now, another important question: do you kow how to stop hair loss? (Just kidding)
Jeff said,
September 1, 2006 @ 3:36 pm
I have a website that has excellent positioning in Google but I have been afraid to update the website fearing I will lose positioning within the search engines, will I be safe using the 301 redirect as you have described. Thank you for your help.
Pieter said,
August 29, 2006 @ 12:50 pm
I have a question…
How do you redirect and maintain a path? Say I want to do a masked redirect of a page (www.joysof.com/2006/08/atom-feed-live.html) to my wacky address but maintain the /2006/08/ path.
It will also have to do this for every future file and directory too since the site is constantly updated
Steven Hargrove said,
August 28, 2006 @ 1:34 pm
Hooollly cow…. I really wish I had time to asnwer all of your questions…. perhaps in another post… Sorry to those who had questions that I was not able to answer, there is not enough time in each day!
Eva said,
August 24, 2006 @ 8:34 pm
Steve,
Thanks so much for the awesome info. I outsourced the development of my website to a team in Romania who is simply not available to fix bugs or answer questions in a timely way, so I am having to do it myself. One of the things that they did (my site originally dealt with photography and videos) was to dynamically assign numbers to products, such that when you click on the product for detail, you get an url that looks like this:
touchinfinity.com/product_large.php?pid=31
First of all, some submissions won’t accept the URL, because of the ?pid=31 part. Secondly, this product is a unique Hawaiian Sunrise Meditation Video that I would like to submit as a ‘meditation video’. So I want the page name to reflect the product. When I tried to use the 301htaccess method and I typed in the new name (e.g. touchinfinity.com/meditation_dvd.htm/, it did not redirect back to the correct .php?pid=31. It just showed the word ‘OLD’, which I had typed in the htm page. I’m wondering, did I put the file in the wrong place? (I’m being hosted by a company so I’m not sure if I’ve put the htaccess file in the root or not - it’s in the same directory as my index.php file. Any help is greatly appreciated!
Thanks!!
Amit Chouhan said,
August 23, 2006 @ 1:36 pm
Hi Steve,
I am using the PHP language for this,
but i having one problem i want to keep the URL of my old site in the address bar and want to redirect it on the new page,so that google rank my url.
is it possoble to redirect the page to new URL and show the old URL in the address bar.
Please help me to solve my problem.
Dave said,
August 17, 2006 @ 10:57 pm
Nick: on Windows servers, go to manage your IIS site (r-click my computer > manage > Services and Applications > Internet Information Service > Web Sites > [your site]). If you want to redirect the entire site, right click its name and select Properties. Then go to teh Home Directory tab and follow the steps in Steven’s info above. If you want each file to go to its maching file in the new location then DON’T check the “The exact URL” box and the client/search engine will find the same file relative to the new URL you specified. Also, don’t put a “/” at the end of that URL.
MY question: I followed these instructions for IIS and it worked great. But my subdirectories, like /images and /css are still accessible at the old location. Do I have to give each subdirectory the same treatment?
Nick said,
August 16, 2006 @ 6:05 am
My new hosting service uses Windows servers. Most of the solutions discussed above are for Apache servers. Several people have asked how to do a 301 redirect on a Windows server, but the answers to those questions are few or missing entirely.
I moved my entire site from my old URL and hosting service to a new URL and hosting service. I had my old domain registrar change settings to point to the new hosting service DNS. On the new hosting service I set my old domain name as an alias for my new domain name. Both domains now resolve to the same IP address, so I have no way to set up a redirect on the old domain that won’t be seen on the new domain, since they are the same.
The result is that Google is still indexing my site under the old domain as well as under the new domain, which has been active for 6 months now. My site is in 1st place on several vital Google searches, but with the old domain. How can I fix it so Google only indexes under the new domain without simply dumping the old domain, and with it my high page rank and 1st place search position? My site is entirely static HTML coded. Thanks for any help.
michael said,
August 10, 2006 @ 8:10 pm
We recently converted a site from .asp to .NET. The site address hasn’t changed officially, but the indexed pages on Google are incorrect (IE: http://www.mysite.com/index.asp) doesn’t exit any longer, but the base URL is still there). Most people won’t necessarily click on the 404 error link to the base URL.
In IIS, all we’ve done is redirected to the new site folder so I can’t do it in IIS. I’m curious if there’s a simpler method other than recreating each former page as a redirect (in asp or html) to it’s new, improved page? I only need to do this until our site is re-indexed on the search engines.
NinjaDoll said,
August 9, 2006 @ 7:27 pm
Great info, thank you very much! I would like to ask if it’s possible to use .htaccess to redirect the main site’s index.php to an index.php in its own subdirectory (www.siteA.com/index.php to http://www.siteA.com/newinfo/index.php) without breaking other redirects to other subdirectories. What I’m trying to create is:
http://www.siteA.com/index.php to http://www.siteA.com/newinfo/index.php
http://www.siteB.com/index.php to http://www.siteA.com/siteB/index.php
http://www.siteC.com/index.php to http://www.siteA.com/siteC/index.php
It seems that once you redirect the main index.php file to a subdirectory, it breaks any other redirects to subdirectories on the same site. So nothing else works on the site except the very first redirect. Is there a way to work around this without having to rebuild the site?
Chris said,
August 7, 2006 @ 4:00 pm
I need to do a 301 redirect for an old site I have. We made a new site to replace the old site, but we have kept the old site because google likes it. I want to use a 301 redirect to tell google to use the new page now. Our server uses linux. I don’t see linux on your list of 301 redirect options. Maybe Linux has nothing to do with it. I tried the htaccess file but was unable to create the file. Is there a specific way to do this with a linux server.
Radu said,
August 6, 2006 @ 10:15 am
Hello Steve,
I have a question which i believe is related to this. When i access my homepage http://www.intelligentit.ro i see a page rank of 1. This is actually the index.php. If i access directly http://www.intelligentit.ro/index.php i see a page rank of 0. How does the redirection from the first to the 2nd link occur? Is this a 301 redirection? If not, how can i make it as one so i don’t lose any page rank between the root directory and the index.php.
Thanks, Radu
Jonathan said,
August 3, 2006 @ 1:47 pm
Thank you so much for these scripts and this service. I tried using the asp script so the entire page looks like the page below. However, it does not work. When I go to the page that should redirect it just shows the code rather than actually going to the new page.
Can you help? Thank you,
George Kwenya said,
August 1, 2006 @ 1:31 pm
Hello Steve,
I am to redirect any user who tries to access a password protected page (e-learning) to the login page or registration page and after that redirect the user back to the page he/she is trying to acess. Please how can I fix this problem. Thank you.
Christopher said,
August 1, 2006 @ 4:40 am
In the .htaccess file, how do I redirect all pages within a certain directory to go to our index.htm page? Would the below work?
1. Redirect 301 /old/*.* http://www.you.com/new.html
Jay Heuer said,
July 31, 2006 @ 8:29 am
Dude, you are a saint on some of these questions! Geeeesh
Michael Conquest said,
July 26, 2006 @ 8:53 pm
Great article Steven! Very helpful…I had been using a meta refresh redirect for my main domain name redirecting to a split test. Looks like I’ll be changing this using either the htaccess or php methods. I’m just now setting up a site-map and noticed only 1 page was indexed with the sitemap so that tells me that Google doesn’t like my meta-refresh as since it’s redirecting it can’t crawl the rest of my site with the sitemap?
Any comments you could provide just send me an email…
Thanks,
Michael
Free Articles said,
July 24, 2006 @ 4:02 am
How can we redirect a .html page to any other url.
Kristy said,
July 20, 2006 @ 4:22 pm
I’m hosting on a windows server and need to create permanat re-redirects for a dynamic page. The original page dynamiclanding.aspx was used by multiple different categories so the url would look something like dynamiclanding.aspx?CategoryID=10 or CategoryID=11 and so forth.
I have created custom dynamiclanding pages in order to be able to optimize for the search engines. So now, I have pages like this dynamiclanding-1keyphrase-2ndkeyphrase.aspx. I need to re-direct
http://url.com/dynamiclanding.aspx?CategoryID=10 TO http://url.com/dynamiclanding-1keyphrase-2ndkeyphrase.aspx?CategoryID=10 and http://url.com/dynamiclanding.aspx?CategoryID=11 TO http://url.com/dynamiclanding-3rdkeyphrase-4thkeyphrase.aspx?CategoryID=11
I can’t simply redirect the dynamiiclanding.aspx to any one specific page since the variable needs to be there. The base page, dynamiclanding.aspx DOES still exist, so I’m not worried about users getting an error while the SE’s update their index to the new pages; however I want my pagerank to be tranferred. This site has very good rankings and I do want to be dropped due to having all of my pageranks drop off.
Any help would be appreciated.
anatolijd said,
July 20, 2006 @ 2:35 pm
i found the reason, please ignore this and my previous post, as the issue i found has nothing to do with IIS…
anatolijd said,
July 20, 2006 @ 12:56 pm
301 Redirect using IIS 6.0

Hm…
I`ve tried to do so,
set a redirection to URL
checked “exact ULR enetered” and “permanent redirection for this resource”,
but IIS constantly returns “302 Redirect” instead of 301:
$ telnet http://www.preved-medved.com 80
Trying X.X.X.X…
Connected to http://www.preved-medved.com (X.X.X.X).
Escape character is ‘^]’.
GET /redirect_test.html HTTP/1.1
Host: http://www.preved-medved.com
HTTP/1.1 302 Redirect
Content-Length: 149
Content-Type: text/html
Location: http://www.google.com
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Date: Thu, 20 Jul 2006 08:25:54 GMT
…
Has anybody ever seen this issue also?
Randy said,
July 19, 2006 @ 3:33 pm
Hi Greg A.,
I would like to implement the .NET solution you mentioned in yor post. Would it be possible for you to send me an example of this implementation? I would really appreciate it.
Thanks!
A Samuel said,
July 19, 2006 @ 8:18 am
Hi,
I am not a programmer so forgive my lack of knowledge.
My web developer has developed a site in asp on IIS6 and I have problems with the 404 page. The rewrite rules have been set up to redirect to sitemap on any files that are not asp. However on a dead page that has the extension .asp the rewrite rules behave differently and instead of a 404 it returns a 302 which google doesnt like.
Can this be fixed easierly as my web developer says its not possible??
Any help would be greatly appreciated.
Thanks
Adam
Attila said,
July 19, 2006 @ 7:42 am
Hi,
Here is the answer to my question posted above ( http://www.stevenhargrove.com/redirect-web-pages/#comment-214” )
One can set up a mod_rewrite condition to test for the availability of a particular uri via a subrequest and based on the outcome perform a url rewrite and hand the request over to mod_proxy.
The only drawback is that it hurts the performance (if the subrequest turns to be valid then the server will respond to the client by completing the original request cycle which results in doing the same thing twice).
This overhead is not mod_rewrite specific: there is no really good solution for this problem.
–Attila
Pierre Legrand said,
July 15, 2006 @ 6:27 am
Have gotten my new site completely set up and spent the better part of the day writing my redirect 301 .htaccess file to redirect my 100 highest rated pages.
First question is it possible to simply redirect all requests to my old url to my new url using 301?
Second question which probably is a lot more important than the first….how is this done using Front Page extensions? My current host Value Web says that using .htaccess to redirect will break the old site. This is immensely frustrating as I tried and it did. It is back up now after reinstalling the front page extensions
Any suggestions would be highly welcome.
Thanks in advance
Quick Question said,
July 12, 2006 @ 6:19 pm
Ok, well I worked out what my problem was (was in fact just a error on my part). I changed error_sitedisabled.php so it didn’t read from the same header file (that contained the redirect script) from the rest of the site.
Problem: Was redirecting when it already had redirected to the correct page.
Solution: Isolated error_sitedisabled.php with it’s only configuration, seperate from the rest of the site.
Thanks again for the great article.
Quick Question said,
July 12, 2006 @ 5:51 pm
This is an excellent article! I did have a question on something I have been trying to work out all day though.
I wrote a config file to control if the website was “Disabled” or “Enabled”. But when I view the page (my guess if from an error on my part…) it keeps trying to refresh the page using that address. (To clarify, I am using PHP) Here is some clippings from my config file:
[code]
// This will disable the entire site (even from admins), Options: 1=Disabled, 0=Enabled
$sitewide_disable = “1″
// Code for disabling site (runs before any html output)
if ($sitewide_disable == “1″) {
header(”Location: http://www.example.com/error_sitedisabled.php“);
exit(0);
}
[/code]
Attila said,
July 12, 2006 @ 3:18 pm
I want to redirect requests to another web server when they result in 404 Not Found on my server. How can I do that without going back to the client and without mod_perl?
Many thanks, –Attila
Sarai said,
July 12, 2006 @ 2:10 pm
How can I redirect “index.htm” to “Folder/index.html” ? I have apache on Linux Server.
I need that when the user visiting my site, the displayed page is “Folder/index.htm” and not directing at root (index.htm).
tracy said,
July 12, 2006 @ 9:47 am
Can anyone help? I have recently moved my site from freeserve webspace to a new domain with another webhost. All I want to do is redirect people from the old site to the new one. I fount this great article, and tried the .htaccess file (which I created and put in the root dir) but it won’t work. Is it something to do with freeserev using windows rather than linux? Freeserve (or wanadoo or orange or whoever they are now) have been no help at all - they say they no longer offer support for the freeserve webspace. Any help much appreciated!
Steven Hargrove: Blog Article Piracy?! said,
July 10, 2006 @ 1:41 pm
[…] When I naively starting blogging, it never occurred to me that I would have problems that I’m sure many other bloggers are having these days. I’m talking about blog article piracy. I recently discovered more than 15 sites who have decided upon themselves to take one of my most hard-worked articles and stick it up on their site. For example, look at this site who took my entire article and slapped it on thier site: http:// www*webknowhow*net/dir/Other_Resources/articles/SmartRedirect.html (remove spaces and replace *’s with .’s). […]
Annie said,
July 7, 2006 @ 11:47 am
How can I redirect mysite.com to http://www.mysite.com? I have windows hosting and I use IIS. I’m familiar with the Mod rewrite method… But is there any other methos as easy as it in .htaccess and that does not involve mod rewriter.
greg said,
July 7, 2006 @ 6:57 am
While I had the decent idea of redirecting people who type variations of domain names I’ve registered (fictionaloneofmydomains.com; fictionalanotherofmydomains.com;) to my site fictionalmaindomain.com, I was clueless about the ins and outs. Thank you for taking your time to post tips and respond to questions, Steven.
Allen said,
July 6, 2006 @ 3:19 am
How can I redirect “all” of the invalid urls to a particular page. Right now I have about 1000 hits going to the 404 page. I have a note on the 404 directing them to my home page. I have read about the 301 redirect in your tutorials by using the .htaccess but that seems to be written if you know what the old url is. Is there a was to accomplish this?
Thank you
jack said,
July 4, 2006 @ 3:52 am
hi,
I had some problems with my server. I was wondering, if i need to redirect to a new page and that page is not working(server down) and i want to redirect on another server and still the server not working and i want to move on another one, can this be posible? I want to know if there is a script like he checks for broken links from a list and if one is working to be redirected to that one. Thank you,
agaton said,
July 2, 2006 @ 4:48 pm
Really good guide!
Creation Robot said,
June 30, 2006 @ 1:11 pm
How to redirect a web page
I’ve been using the cheap ass HTML redirect way for my ‘Top 100 OS X Apps’ for ages now, I really need to get with the right way of doing the redirect - the 301.
The best way to redirect those pages is by using something called a R…
Scott said,
June 30, 2006 @ 3:50 am
I found this article very helpful. Thanks.
Jay Reding said,
June 29, 2006 @ 5:14 pm
In Ruby on Rails, if you’re rerouting someone to another part of your application, you’d need to use routes instead.
To do that, just add a line to config/routes.rb like:
map.connect ‘old_action’, :action => ‘new_action’
Or you can even send them to a completely new controller.
map.connect ‘old_action’, :controller => ‘new_controller’, :action => ‘new_action’
That doesn’t generate a 301, but it does seamlessly redirect people within your application. If you’re redirecting someone to another page outside the application, the other way is the way to go.
jim said,
June 28, 2006 @ 4:58 am
Question for you 301-meisters:
I use an apache htaccess file to get ‘friendly’ urls, basically setup to a) make it all www then b) map a non-ended url to the correct file ending.
All good but I would like to have a list of possible mistyped urls with a 301 redirect a-la methods outlined here. Eg. a signing page at http://www.x.com/pages/signin, if someone types http://www.x.com/signin it would be good if they ended up at the right page.
I’ve tried this method (between the www-rewriter and the ending-director):
Redirect 301 /signin http://www.x.com/pages/signin
but it ends up a ’server loop’ as the redirected ending is the same as a the flagged ending, so I guess it tries to find (in an infinite loop):
http://www.x.com/pages/http://www.x.com/pages/http://www.x.com/pages/…
Any ideas?
GayLjungberg said,
June 27, 2006 @ 10:16 pm
Thanks for a great resource!!!!
I have totally rebuilt my site (a webshop) from static htmlpages to dynamic asppages.
In the old structure there was “pages”, in the new structure there are “products”.
In other words I cannot move page a to page b using your advice for 301 Redirect Using IIS. Is it any point in redirecting a folder (containing several html pages) to the index.html at least bringing in visitors through the new the front door. The alternative would be to delete the old files and let them see a 404 message instead. And what would be the effekt on SE. (The old pages are from 1996- and well indexed and ranked fairly high)
Vikram said,
June 26, 2006 @ 7:13 pm
I’m trying to implement this in JSP. My code is:
if (x) {
response.setStatus(301);
response.setHeader( “Location”, “http://www.vermontcountrystore.com/” );
response.setHeader( “Connection”, “close” );
}
y statements;
This code is enclosed inside an if block as shown. There is a bunch of other code below this if block (y statements).
My concern is that the code after the if block is also getting executed. The redirect must happen inside the if block and control should not reach the y statements. But unfortunately this is not happening.
The moment I comment the code for y statements, redirection works fine which ensures that the code is correct for redirection. Looks like I have to do some flushing or something soon after the last line of redirection?
Please advice.
Fred said,
June 26, 2006 @ 1:35 pm
Is there a way - using your first .htaccess method - to add a message to flag the change of address to the user while the redirect is under way? Would this slow things down?
Thanks for the tips - I would have had no idea about how to do this without being penalised by the search engines.
James said,
June 25, 2006 @ 4:50 pm
Hi Steven,
I am having a problem with google sitemaps and my 301 redirect in my htacess file. It looks like google is mixing up my redirects and in turn creating 404 not found errors. For example, I have a 301 redirect to http://www.runningrascals.com/about%20us/index.htm, but for some reason it is picking up other words and placing them at the end of the redirect like this:
http://www.runningrascals.com/about%20us/index.htmindex.htm
or
http://www.runningrascals.com/about%20us/index.htmsunnyisles.htm.
beatnik said,
June 23, 2006 @ 4:19 pm
You forgot to load the CGI module in your perl example. Add a ‘use CGI;’ before those lines (without quotes, obviously).
Don Strack said,
June 22, 2006 @ 3:27 pm
I converted all my pages to PHP by doing the coding, then saving them with the same name, but with .php as the extension instead of .htm. Trouble is, the search engines keep finding links to the old .htm pages.
Is there some way of globally redirecting an .htm page to its current .php equivalent?
Chris said,
June 22, 2006 @ 6:05 am
When using the PHP redirect, I usually add :
exit(0);
after the redirect so that the remainder of the page does not get parsed. This may help speed things up and halt the page from any further updates it may make.
Philippe Leblond said,
June 22, 2006 @ 3:29 am
This 301 redirect has solved an annoyance that has lasted years for me when my first web host was sold and I had to get my own domail name and transfer all my website.
Thank you
Javier Caceres said,
June 22, 2006 @ 2:10 am
Dumb question, Where do I place the code? Ia a apge, on which one
Thank you
Tad said,
June 21, 2006 @ 9:54 pm
For the .htaccess examples, shouldn’t you remove the “1.” before the “redirect”? I tried this with the 1. and Apache blorfed for all requests. Without it, it works just fine.
radial module said,
June 21, 2006 @ 9:28 pm
Hey, what happened to Eric?
j/k
This is great Steven, thanks so much for taking the time to put all of this together.
Jos said,
June 21, 2006 @ 6:46 pm
Great to have this overview of possible 301 redirects. My problem is that I have an index.html file on a very old server (_not_ my own), where none of these redirects are possible. The provider won’t allow them, however I beg them. Only HTML or JavaScripts would be possible, but that would bring me nothing, as Google doesn’t like them. I have once read that a HTML with a long refresh time would maybe be acceptable for Google. Do you know anything abouth this? Any other tips for me?
Thanks!
James McDugal said,
June 21, 2006 @ 6:32 pm
Not only is this a great item, the comments are great too: The idea of using the bad url as a param to help find the correct new url is brilliant.
Although, perhaps one brainstorm: if no new URL is found to match the old, rather than sending the user to a 404, return a 302 status and send them to a search-results page from the site, using the words in the url as search terms. Might get them one step closer to where they orignially wanted to be.
Hey Eric Newman, go do you homework. Or take out the trash. Or play outside.
Zach said,
June 21, 2006 @ 6:18 pm
Great little tutorial if you will, very helpful. I have a question that I need help with however.
Let’s say I’m going to be putting up an entire new site, the site happens to be hundreds of pages and many if not all of the URLs have changed, how would I go about simply making anything not found just 301 Redirect to my homepage? Could I simply embed the PHP 301 into a 404 page or does that just defeat the purpose? Either way, I think you see what I’m trying to accomplish and not get penalized in the SEO world.
Thanks!
Chris said,
June 21, 2006 @ 6:17 pm
Works greak on IIS, was trying to figure out how to do this for my new site that I’m working on. Great tip.
Ganesh said,
June 21, 2006 @ 5:58 pm
Thanks, this is really helpful.
Jorgeq said,
June 21, 2006 @ 5:32 pm
Indeed a great tutorial. I’ve been meaning to apply this very same practice to my domain. Great, thanks!
Scott said,
June 21, 2006 @ 5:21 pm
What a great and timely post!
I was lazy a few weeks ago and used my server’s control panel to do this and it was issuing 302 (Temporary Redirect) instead of 301 and a bunch of my pages are showing up as supplemental results now
I have been using mod rewrite to fix the canonical issues, but now I have to attack the moved pages on my site.
Thanks!
Jason said,
June 21, 2006 @ 4:45 pm
I’m having a hard time configuring my .htaccess file to forward from a ~quake url.
The url I want to forward is:
http://www.employees.org/~quake
I’d like to forward it to:
http://rtoo.livejournal.com
The problem I’m having is the 301 file is forwarding to:
http://rtoo.livejournal.com/~quake
Any Suggestions?
Mike said,
June 21, 2006 @ 4:27 pm
Hey,
ASP (& ASP.NET) use 302’s instead of 301’s when you invoke the redirect using “Response.Redirect()”. Can you explain the difference between these two and why you prefer 301’s?
Thanks,
Mike
Christian said,
June 21, 2006 @ 3:49 pm
If you are using the CherryPy web app framework, you can do:
raise cherrypy.HTTPRedirect(’/path/to/new_resource’, 301)
Peter Goldschmidt said,
June 21, 2006 @ 3:38 pm
Do search engine spiders follow the redirect and travel to the new location?
BDizzleFizzle said,
June 21, 2006 @ 3:17 pm
This is extremely helpful, Steven.
Can I just say, Eric, please leave this poor guy alone. You’re asking random questions that are totally unrelated to what Steven has taken the time to instruct on, and are harrasing him and bothering all of us. How about using Google and getting answers to your questions.
Codeninja said,
June 21, 2006 @ 3:10 pm
the Rails Way…
def old_action
headers[”Status”] = “301 Moved Permanently”
redirect_to “/”
end
Pat said,
June 21, 2006 @ 3:03 pm
ERIC-
PLEASE STOP POSTING THESE PERSONAL QUESTIONS ON THE TOPIC OF 301 REDIRECT!!
FOREIGNERS-
THIS IS AN ENGLISH SPEAKING WEBSITE.
Clarke said,
June 21, 2006 @ 2:56 pm
I have been dealing with this in my own code lately and have used the section of my web config to match using wildcards and call my own method. A good explanation can be found here.
http://scottonwriting.net/sowblog/posts/4336.aspx
My question is a bit different though. If I have pages that need to run https and a user comes in via http, how should I redirect them? Currently I am doing a 302 redirect using Response.Redirect, but I am not sure which should be used. The page is not really moved, I am just saying I want to give it to you over another protocoll.
Astoria NY said,
June 21, 2006 @ 2:34 pm
Thank you! This was exactly what I’ve been looking for for a very long time. Sadly, I’ve been using an HTML redirect and wondering why in the world Google was hating me so much.
kL said,
June 21, 2006 @ 2:31 pm
Don’t forget status 303 - neccessary when redirecting after POST (which, due to stupid bug/feature in IE caching, is a good idea).
Matt’s Journal » Redirecting Web Pages said,
June 21, 2006 @ 2:20 pm
[…] Anyways, take a look @ http://www.stevenhargrove.com/redirect-web-pages/ Home […]
StickBlog » Blog Archive » Doing redirects the right way said,
June 21, 2006 @ 2:19 pm
[…] A handy guide to implementing 301 redirects — ie. the ‘proper’ way to do it. It has info on how to do it in .htaccess, PHP and various other environments. […]
Indrek said,
June 21, 2006 @ 2:11 pm
Thanks, very useful guide. Two suggestions, though.
1. you might want to mention that both .htaccess and mod_rewrite are *nix-only and don’t work on Windows servers.
2. second, an equivalent for the above two in Windows would be to use global.asa (or global.asax in .NET). Something like this:
Sub Application_BeginRequest(sender as Object, e as EventArgs)
If Regex.IsMatch(Request.Path, “oldpage.aspx”) Then
Response.Status = “301 Moved Permanently”
Response.AddHeader”Location”, “http://www.yourdomain.com/newpage.aspx”)
End If
End Sub
ought to work in .NET. Writing this off the top of my head, though.
Using regex makes it very simple to redirect all foo.asp pages to foo.aspx (say, if you’ve upgraded from vanilla ASP to .NET), or redirect to another domain, et cetera.
Macslut said,
June 21, 2006 @ 2:10 pm
What’s to stop spammers from using these techniques, and then following that, what’s to prevent search engines from penalizing these techniques equally with a meta-refresh?
Jon Z said,
June 21, 2006 @ 2:00 pm
Great method! I’ve heard of 301 before, but never seen any examples on how to execute it. Thanks for the examples, ALL OF THEM!
–Jon Z
Bas said,
June 21, 2006 @ 1:39 pm
This was great, thank you!
geekinabox said,
June 21, 2006 @ 1:36 pm
One aspect of redirects that is often missed is how to redirect a POST. The 301 redirects always result in a GET to the ‘new’ redirect location. So if the original request was a POST, and a redirect was sent back, then most browser (as per the HTTP spec) does a GET to the new location. As such, the POST data is ‘lost.’ This may not always be the desired behavior for many applications … i’ve seen many instances where people want a ‘POST REDIRECT’ analagous the GET redirects we have today.
The way to make this happen this is as follows
1.) Respond to GET requests w/ a typical 301 redirect.
2.) Respond to POST requests by:
a.) sending back to the user an HTML form with an action of POST to the new location
b.) the form should be populated w/ hidden fields containing all of the POSTed name/value pairs (IOW, construct a form to repost the data, but do it w/ hidden fields … no visible user input)
c.) have javascript auto submit the form on the body.onLoad event of the page you send page
… this will cause the data to be reposted to the new location. We use it frequently here. If you fear that users may have javascript turned off, then, on the hidden form page that you send back, include a submit button w/ text that says “we are currently locating the best server to serve your request; click submit if this message displays for more than 10 seconds” …. or something like that.
this should be pretty easy to code up in any language.
steve mayes said,
June 21, 2006 @ 1:29 pm
Great article, articulate and well put together. Also can I congratulate you on your tact and patience
frappa said,
June 21, 2006 @ 11:18 am
very interesting and useful, thanks
EL FENIXBLAU » Blog Archive » Diferents formes de redirigir una web said,
June 21, 2006 @ 5:58 am
[…] redirigir […]
Bill Hutchison said,
June 21, 2006 @ 3:38 am
Thank you.
I had used the html redirect because it was easy and I didn’t know any better. The .htaccess redirect works great, and still lets me set-up sites on sub-domains.
I had previously had Yahoo auto-redirect the domain, but I had no way to use sub-domains. This has been very helpful.
Hanagriff.com » Steven Hargrove: How to redirect a web page, the smart way said,
June 21, 2006 @ 3:31 am
[…] Steven Hargrove: How to redirect a web page, the smart way […]
Greg A. said,
June 21, 2006 @ 2:34 am
I’ve been using the following technique with .NET:
1. Redirect to the newsite via IIS.
2. Created a custom error page that takes the requested page as a parameter, “aspxerrorpath”.
3. Code behind searches an XML file containing all the old page names. If a match is found, I redirect to the new page (also in the XML) and return a 301 as noted above. I also send a Response.End. That’s not in your code, but I’ve found it necessary.
4. If no match is found, I display the error page and return a 404 error.
I’ve found this to be a useful approach as it allows you to redirect a set of pages to a particular new page (for example, if you have old landing pages that you now want directed to your home page). You can also use it to redirect only those pages receiving high traffic to their new counter-parts while transferring link popularity of everything else to your new homepage/landing page, etc.
Any thoughts?
Best,
Greg
Anonymous said,
June 21, 2006 @ 12:36 am
How to redirect a web page, the smart way with 301’s
The best way to redirect web pages is by using something called a “301 Redirect”. What this 301 redirect does, is it blatantly redirects to a different page when it is triggered, what makes the 301 redirect the best, is that not only does it accompli…
Bloggitation » links for 2006-06-21 said,
June 21, 2006 @ 12:22 am
[…] How to redirect a web page, the smart way (tags: web programming blog) […]
xazz said,
June 20, 2006 @ 10:56 pm
What about on a Windows server? .htaccess files do not appear to work. What is the equivalent file to use (I don’t have access to the IIS console).
aaron dalrymple dot com » Blog Archive » SEO Friendly URL Redirects said,
June 20, 2006 @ 9:12 pm
[…] Steve Hargrove - How to redirect a web page, the smart way - added 6/20 […]
BlogOnRails.com » Blog Archive » Como redirigir una página, la manera elegante. said,
June 20, 2006 @ 7:08 pm
[…] Interesante artículo donde se explica el uso de “301 Redirect” como forma de redireccionar páginas. Modificando el .htacces, con ASP, PHP u otros. […]
The Intern said,
June 20, 2006 @ 6:59 pm
[…] How to redirect a web page, the smart way […]
Hey, techno! » Redirection de pages web said,
June 20, 2006 @ 6:48 pm
[…] Voici un article de Steven Hargrove sur comment effectuer la redirection d’une page web. À ajouter à ses favoris. […]
Steven Hargrove said,
June 20, 2006 @ 6:17 pm
I suppose you could use Response.Redirect, what is important is keeping the header execution that specifies that there is a 301 redirect happening
Patrick Corrigan said,
June 20, 2006 @ 6:13 pm
Why not just use Response.Redirect for classic ASP?
Steven Hargrove said,
June 20, 2006 @ 6:09 pm
Marios, I don’t recall running into an issue by not including that, but I suppose some spiders/browsers may look for that particular header when a 301 redirect is processed. I have added it to the manual above, thanks!
Art-One said,
June 20, 2006 @ 5:42 pm
Thanks for the veryusefull information.
Marios Alexandrou said,
June 20, 2006 @ 5:09 pm
For PHP I include one more line with my redirects i.e. in addition to the 2 you have:
header(’Status: 301 Moved Permanently’);
I’m not sure why it’s needed (I’m new to PHP), but without it some of the online server header checkers were reporting my redirects as 302’s instead of 301’s.
Any thoughts on this additional line of code?
akella said,
June 20, 2006 @ 5:03 pm
i used to use this one, if someone find it useful… use it when site moves to other domain so all the links like
“http://site1.com/2005/02/07/”
should redirect to
“http://site.com/2005/02/07/”
Options -Indexes +FollowSymLinks{IfModule mod_rewrite.c}
Redirect permanent / http://site.com/
{/IfModule}
Sure {} should be replaced with (< > )
Christian Asche » Steven Hargrove: How to redirect a web page, the smart way said,
June 20, 2006 @ 5:02 pm
[…] Ein korrekter HTTP Redirect in PHP, Java, ASP, ASP.NET und Perl findet sich unter How to redirect a web page, the smart way. […]
Best ways to redirect a web page - davecentral Planet David Central & Dave Central Planet said,
June 20, 2006 @ 4:52 pm
[…] The article looks at eight different ways to accomplish a 301 redirect, including 301 redirect using htaccess, 301 redirect using IIS, 301 redirect using PHP, and more. Probably something that needs to be printed out ASAP and pasted into your Web Design handbook. — Wendy Boswell How to redirect a web page, the smart way [via .etc] […]
Kevin Baggs said,
June 20, 2006 @ 4:11 pm
I recently switched from Blogger to Wordpress. The only way I am aware of is to use and HTML redirect on Blogger. Will one of the other methods you suggest work with Blogger?
Thanks,
Kevin
Tim Raines said,
June 20, 2006 @ 4:02 pm
Excellent guide!
I think there’s actually an easier way in ASP (if memory serves) to redirect using a 301:
A little shorter, but more importantly, a little easier to read and understand immediately.
Sorry for the re-post. Didn’t use the “code” tag before, so the code disappeared.
Jimbo said,
June 18, 2006 @ 11:59 am
Or if you haven’t the time you could use a free service like
GoStubby.com they offer true 301 redirects, and many other features!
I Agree 301 is the best way to go, very search engine friendly!
301 is permnent, S.E.O friendly
302 temporary, and you do get penelized
Eric Newman said,
May 26, 2006 @ 1:45 pm
hi steven i know this isnt about web design but how do you make a picture as a icon because i save a pic to a .ico for an icon file so when i pick the picture to change it says it isnt any icons and it says it is an icon file.
please help
Steven Hargrove said,
May 24, 2006 @ 12:41 pm
invoking a 404 error will stop the client in it’s tracks, whether it be me visitng the page, or a spider crawling the website, basically if there was once content on the page and it has been moved to a new location, it is always a good idea to redirect the old url to the new. I highly suggest noy invoking a 404 on your pages if simply the url’s have been changed.
James said,
May 24, 2006 @ 9:12 am
Thz for your speedy reply Steven.
Currently I using this method by inputing this line in .htaccess:-
ErrorDocument 404 http://mysite.com
would it cause any foreseenable harm? In term of SEO? robots crawling? google PR?
Thanks again for your kind guides.
Steven Hargrove said,
May 24, 2006 @ 2:11 am
well, I believe I understand what you mean…
there are a few things you could do actually, the site appears to be created with php, so you could place some php logic somewhere in the coding to check if that particular forum thread or section exists, etc. However outside of this there isnt a way to detect a 404 error prior to it actually giving a 404
Another way you may be able to do it is by using mod_rewrite to redirect all page named similarly, for example something like this::
This would redirect any page with the category[X].html?[x] to your home page, but then again you couldnt really rule out all of the other pages with it so it may not be very helpfull, although you might want to check some official mod_rewrite documentation to get a better understanding of it.
James said,
May 21, 2006 @ 5:53 pm
Thz for this guide.
I need some help:-
I just revamp my old site to a forum, thus all my old pages are having error as “Not Found” of course!
How do I re-direct all those old pages to my home page irregardless of the old path as long as it is 404error?
eg: http://suggestionsite.com/category24.html?PHPSESSID=2347ab8edbc321d3a54ab9b1f9aed45c
http://suggestionsite.com/category128.html?PHPSESSID=24c7a27cee7a03c4193ddf7ef6289630
http://suggestionsite.com/category21.html?PHPSESSID=2347ab8edbc321d3a54ab9b1f9aed45c
AT the moment, I’m manually redirect it one by one, and it is just very painful in doing it one by one. Any advise to re-direct alll the old pages not found at one go?
Sincerely
James
Eric Newman said,
May 19, 2006 @ 2:08 pm
what do you mean “redirect you are trying to use, and what kind of language? php? asp?”Im just trying to make a music web page using web page maker and i put a sourse in after i use the web program to put radio.blog on and when i do that, i load the page up and it shows what i wrote last to you it stills shows the page but it has a little window that has all that writting i wish i can explain more but i can’t
Steven Hargrove said,
May 19, 2006 @ 1:43 pm
Eric, I understand that you are having a problem,but I am still waiting for you to tell me what kind of redirect you are tyring to use, and what kind of language? php? asp? what?
William, redirecting a web page with flash is highly not recommended as it is a quick way to get penalized by a search engine because it does violate the guidelines of the major search engines. Most sites that I have seen that use flash to redirect a page, they seem to assume that search engines wont notice, but trust me that could not be further from the truth.
William said,
May 18, 2006 @ 9:51 pm
I recently visited a web page that used a Flash redirect. Have any idea how this can be done?
Eric Newman said,
May 18, 2006 @ 7:54 pm
This is what it says on my page
The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
——————————————————————————–
Invalid at the top level of the document. Error processing resource ‘file:///C:/Documents and Settings/Eric/Desktop/Music F…
“; ?>
————————————————–^
Steven Hargrove said,
May 17, 2006 @ 8:45 pm
Ok, so this error happens after you place the 301 redirect code into your web page? which source code are you using? PHP? ASP? JSP? Please be specific.
Eric Newman said,
May 17, 2006 @ 4:13 pm
When i put the source in my page it said
“The XML page cannot be displayed cannot view XML input using style sheet”.
i put the source in after i make the page with web page maker v2 program you don’t see the image of radio blog just the size of it.
Steven Hargrove said,
May 16, 2006 @ 6:56 pm
I am not sure how you’re XML issue relates to a redirect problem, please describe the issue a bit more.
Eric Newman said,
May 13, 2006 @ 1:51 am
Please answer my question Mr.Hargrove i need to know and i have one more question to ask how do i get a sponsorship because i need a bigger harddrive,fast internet,some connections, and a pro of doing this business thing so please tell me i know i sound desprite sorry.If this will make you feel better i will have a link to this site.
eric newman said,
May 9, 2006 @ 7:00 pm
I am trying to make a music web page for my fulture job me and my friend are trying to do this because we both enjoy doing this so my friend found out about this radio program and when i put it on my web page it said
“The XML page cannot be displayed cannot view XML input using style sheet”
and i know the source is correct because it gave me a source to use and it looks right to me i know this program works because i see other web pages work and it specified that windows xp can work which that is what im using (professional)and i talk with other people and they have no idea on this and i have one more question what is redirect web page mean im makeing pages from a web program called “web page maker v2″ i put the source to use the program after i create the page and i know i told where to look for it to.
Steven Hargrove said,
May 9, 2006 @ 5:13 pm
Hello Eric,
Are you trying to redirect web pages? Please say in detail what you are trying to do.
eric newman said,
May 8, 2006 @ 10:23 pm
I am trying to put a radio.blog 2.5 on my web site and when i do all the things it tells me to do it says this on my page.
“The XML page cannot be displayed cannot view XML input using style sheet”.
so can you please help me on this on because i talked to some one that has some brains on HTML like me and she couldnt firger it out so you are my only hope. thanks!
Gerry Quach said,
May 8, 2006 @ 12:47 am
Thanks for this very informative guide, Steven! We’re using this at work now, great stuff.
Paul Christy said,
May 6, 2006 @ 3:05 pm
Thanks so much for your help, Steve….
You should display Google AdSense Network ads on your pages to get paid
for your assistance..
https://www.google.com/adsense/
Paul Christy
Target Marketing Solutions
Howell, MI
Abdul Mueid said,
April 29, 2006 @ 6:51 pm
Hello Steven,
A great guide indeed. Very useful, especially when changing hosts to changing domain names. A lot of times it get frustrating looking for bits of code here and there to get something like this done.
*applauds*