Changes between Version 2 and Version 3 of faq/domain/redirect-web-users
- Timestamp:
- Feb 26, 2009, 2:05:27 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
faq/domain/redirect-web-users
v2 v3 1 1 = How do I redirect web users from one page to another? = 2 2 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. 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. 4 4 5 5 It'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. … … 7 7 There are a couple things that you can do to help make users who loved your site before continue to love your site now. 8 8 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 == 10 10 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. 11 With 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 13 Once enabled, navigate to Administration -> Site Building -> URL Aliases. 14 15 Click Add Alias and then enter the existing path followed by the old URL path. 16 17 In 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 22 First 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. 12 23 13 24 Examples of both kinds of pages: 14 Access Denied: http://schr.org/naughty15 Page not found: http://schr.org/woops16 25 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 18 28 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 == 20 30 21 The first thing you want to do is put the following text there: 31 Whether 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. 22 32 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). 33 First, 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>). 28 34 29 35 A simple Redirect tells your site that, for a specific page, to go to another specific page. The basic redirect looks like this: … … 83 89 This 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: 84 90 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 89 94 90 95