Changes between Version 2 and Version 3 of faq/domain/redirect-web-users


Ignore:
Timestamp:
Feb 26, 2009, 9:05:27 AM (11 years ago)
Author:
Jamie McClelland
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • faq/domain/redirect-web-users

    v2 v3  
    11= How do I redirect web users from one page to another? =
    22
    3 There are times when you are building a new website, where the organization of the new site varies so much from the old one that you can't use the same URLS as the old site did.
     3There are times when you are building a new website, where the organization of the new site varies so much from the old one that you can't use the same URLS as the old site did. 
    44
    55It's a good thing, when possible, to use old URLs because so many people bookmark certain pages. When users with old bookmarks go to your new website, you do not want to give them an unfriendly message saying simply that the page was not found.
     
    77There are a couple things that you can do to help make users who loved your site before continue to love your site now.
    88
    9 The first (ONLY FOR DRUPAL USERS) is to create friendlier pages for when: 1) people try going to a page that they thought was there and isn't and 2) people try going to a page that is outside of the realm of their permissions level.
     9== Drupal Users ==
    1010
    11 Once you create those pages, you can navigate to the 'Site configuration' section of your administrative pages and click on the option that says 'Error reporting (mysite.com/admin/settings/error-reporting). In the spaces provided give the path or node number of the pages you created.
     11With Drupal, you can easily create what are called URL aliases. You must have the module called Path enabled to use URL aliases. The path module is part of Drupal core, so you will not need to install it, just enable it from your Administration -> Site Building -> Modules page.
     12
     13Once enabled, navigate to Administration -> Site Building -> URL Aliases.
     14
     15Click Add Alias and then enter the existing path followed by the old URL path.
     16
     17In addition, Drupal also has options for when:
     18
     19 1. people try going to a page that they thought was there and isn't or
     20 1. people try going to a page that is outside of the realm of their permissions level.
     21
     22First create the page you want to redirect the users to. Then, navigate to the "Administration -> Site configuration section" of your site and click on the option that says "Error reporting". In the spaces provided give the path or node number of the pages you created.
    1223
    1324Examples of both kinds of pages:
    14 Access Denied: http://schr.org/naughty
    15 Page not found: http://schr.org/woops
    1625
    17 The second thing that you can do is to create what is called a redirect. A redirect tells your site that when a person clicks on a specific old link, to go to a certain page on your new site. Information and ways to configure redirects are VAST and VARIED. There are two basic ones that this wiki covers the very basics of: Redirect, and RedirectMatch.
     26 * Access Denied: http://schr.org/naughty
     27 * Page not found: http://schr.org/woops
    1828
    19 First, you will place the code for your redirect in the 'Web configuration' section of your 'Members Control Panel'. The code for a redirect goes after the end of the close of the directory tag (</Directory>).
     29== Options outside of Drupal ==
    2030
    21 The first thing you want to do is put the following text there:
     31Whether or not you are using Drupal, you can always create an Apache redirect. A redirect tells your site that when a person clicks on a specific old link, to go to a certain page on your new site. Information and ways to configure redirects are VAST and VARIED. There are two basic ones that this wiki covers the very basics of: Redirect, and RedirectMatch.
    2232
    23 {{{
    24 RewriteEngine On
    25 }}}
    26 
    27 This tells your configuration that you are about to give it some code for what should happen when people enter specific URL that may or may not exist on your new site. Now for what comes after this...Technically, this text is not necessary specifically for the kinds of redirects that I am showing here.  It doesn't hurt to have it especially in the case that you plan to use other Redirects that require it (RewriteCond or RewriteRule).
     33First, you will place the code for your redirect in the 'Web configuration' section of your [https://members.mayfirst.org/cp Members control panel]. The code for a redirect goes after the end of the close of the directory tag (</Directory>).
    2834
    2935A simple Redirect tells your site that, for a specific page, to go to another specific page. The basic redirect looks like this:
     
    8389This is, again, a very condensed tutorial that is designed to just tell you one way to do things, and not in a way that teaches you deeper principles of these functions. There are other ways to use them as well. Some sites that go into this in more detail include:
    8490
    85 
    86 http://httpd.apache.org/docs/2.0/mod/mod_alias.html#redirectmatch or,
    87 http://www.baldwinit.com/redirectmatch-with-wildcards.html or,
    88 http://www.askapache.com/htaccess/301-redirect-with-mod_rewrite-or-redirectmatch.html
     91 * http://httpd.apache.org/docs/2.0/mod/mod_alias.html#redirectmatch or,
     92 * http://www.baldwinit.com/redirectmatch-with-wildcards.html or,
     93 * http://www.askapache.com/htaccess/301-redirect-with-mod_rewrite-or-redirectmatch.html
    8994
    9095