Re: htaccess redirect of multi pages to multi destinations

by Kid Stevens <kstevens89(at)comcast.net>

 Date:  Tue, 06 Aug 2002 23:22:16 -0600
 To:  hwg-techniques(at)mail.hwg.org
 References:  nucleus
  todo: View Thread, Original
Use a simple little JavaScript on the pages you want to redirect.

At 10:57 PM -0600 8/6/02, Rob Atkinson wrote:
>---
>Date: Mon, 5 Aug 2002 14:15:25 -0700 (PDT)
>From: Complex <complex_hwg(at)yahoo.com>
>Subject: htaccess redirect of multi pages to multi destinations
>
>I am rearranging the (extremely outdated) pages of my site. I
>would like to use the .htaccess file to smoothly redirect people
>from the old addresses to the new ones.
>
>Unfortunately, I only know how to make .htaccess redirect one
>page. The following works beautifully when it is the sole content
>of my .htaccess file:
>      Redirect permanent /first.html zarathud.org/page1.html
>
>If I add to that, then I am suddenly unable to find any page on
>Zarathud. The one page I found describing how to do multiple
>pages says to list each redirect on its own line:
>      Redirect permanent /first.html zarathud.org/page1.html
>      Redirect permanent /page2.shtml zarathud.org/sub/page2.html
>      Redirect permanent /page3.html zarathud.org/boat/page3.html
>
>I also tried several variations: separating the statements by
>commas, semicolons, pipes; only separating the old & new path
>argument pairs by those separators; etc.
>
>No matter what, trying to do multi pages has always broken the
>site: I get 500 Internal Server Error for every page on the site.
>--
>
>The problem Complex, is not using the full URL for the redirect.
>
>http://www.zarathud.org/page1.html
>
>will/should work.
>
>
>Something else you could use; if you have lots of page redirects
>within a directory, want them to go to the same page/directory
>and you want to avoid including many redirects, is to also put
>the following into you .htaccess file:
>
>RewriteEngine On
>RewriteRule /dir/.*(.*) http://www.zarathud.org/page1.html
>
>This means, no matter what page or sub-directory they goto, if it
>is in the "/dir/" specified they will automatically be redirected
>to: zarathud.org/page1.html.
>
>May get a bit confusing for your Visitors so, for the page they
>are redirected to, I would explain; about the re-organization of
>the Web site, they should update their Bookmarks, and you should
>provide a link to the top level of the new directory. Or just
>include the new Navigation Links and let people decide.
>
>
>A working example is on my site where I used to use the Ikonboard
>Forum script. As some people had bookmarked pages within the
>Forum, I had to make sure that no matter which page they went to,
>using an old URL, they would be redirected to the new Forum
>entrance page.
>
>All of the following redirect a person to the same page, because
>they all use the "old" URL which includes: forum/cgi-bin/
>
>http://potentproducts.com/forum/cgi-bin/ikonboard/index.html
>http://potentproducts.com/forum/cgi-bin/ikonboard/wrongpage.html
>http://potentproducts.com/forum/cgi-bin/nosuchdir/???/index.html
>
>I use a Sub-domain for my Forum, but this applies also:
>
>http://forum.potentproducts.com/cgi-bin/ikonboard/index.html
>http://forum.potentproducts.com/cgi-bin/ikonboard/wrongpage.html
>http://forum.potentproducts.com/cgi-bin/nosuchdir/???/index.html
>
>
>And I have the following (all on one line) in my .htaccess file:
>
>RewriteRule forum/cgi-bin/.*(.*)
>http://forum.potentproducts.com/index.html
>
>
>There are certain conditions that need to be setup, in order for
>the RewriteRule to work. If the above doesn't work then contact
>your Hoster/SysAdmin and find out what needs to be done. They may
>have the Server setup a bit differently.
>
>
>And finally... ;)
>
>A little known secret that would not be possible a few years ago,
>will now work without much trouble to the Server and its Resources.
>
>Make this the first line in your .htaccess file:
>
>AddHandler server-parsed html
>
>This allows you to use just ".html" or ".htm" on all your Web
>pages and yet, enjoy all the features/benefits of the ".shtml"
>file. There is some overhead to the Sever but as I say, with
>today's technology and Server resources available, the overhead
>is almost nil.
>
>
>Website Rob
>Helping people create a Potent Web Site

-- 
Sincerely,
Kid Stevens


"Somehow There Must Be A Way Lets Find It."
-Steve Stevens

"Only those who risk going too far, can possibly find out how far they can go."
-T. Ellis

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA