Social Icons

Pages

Wednesday, 12 December 2012

Redirecting Any URL In Your Blog, To Another URL In Your Blog

Several months ago, Blogger Engineering gave us a new Blogger feature - the ability to redirect any URL in a blog, to any other URL in the blog. Like any feature, we found an immediate use for it - something much requested, for a good while.

Other people have found more uses for the redirection feature - and still others have found confusion. The syntax used in the redirection "From" and "To" values is not always obvious - and occasionally there is confusion about what can - and can't - be done with redirection.

This is the URL of this post.
http://blogging.nitecruzr.net/2012/12/redirecting-any-url-in-your-blog-to.html

Using the redirection feature, I can redirect another URL in this blog, to this post - or conversely, I can redirect the URL of this post to another URL, in this blog.

Both the "From" and "To" values in "Custom Redirects" accept any static blog URL, less the base URL of that blog. You cannot specify the base URL - so all redirections will be within the blog itself. You also cannot use a dynamic URL (containing a "?") in a redirect.

The initial use for the redirection feature (at least, for me) was to replace the Home page of the blog, with another page or post - possibly, this post.
From: /
To: /2012/12/redirecting-any-url-in-your-blog-to.html

I could change the Home page of this blog, to start all new readers on the Topics Index page.
From: /
To: /p/topics.html

If I was to change the Title of this post, when re published, the URL would not change. If I wanted to change the URL of this post, I could redirect the desired URL, to the actual URL.
From: /2012/12/redirecting-any-urls-in-your-blog.html
To: /2012/12/redirecting-any-url-in-your-blog-to.html

If I want to allow this post to be accessed from a shorter URL, I can do that. If you click on the shorter URL (below), you will note that you still see the longer URL in the browser address window!
From: /redirecting-any-url-in-your-blog-to.html
To: /2012/12/redirecting-any-url-in-your-blog-to.html


I recently created a shortcut to my Topics index, as "blogging.nitecruzr.net/topics".
From: /topics
To: /p/topics.html

To get the "From" and "To" values for any redirection, I simply take any two URLs in the same blog. Choose any two examples - one for "From", the other for "To".
  • The Home page: http://blogging.nitecruzr.net/
  • A post: http://blogging.nitecruzr.net/2012/12/redirecting-any-url-in-your-blog-to.html
  • A static page: http://blogging.nitecruzr.net/p/topics.html
  • A label search: http://blogging.nitecruzr.net/search/label/Redirecting
  • A shortcut URL: http://blogging.nitecruzr.net/topics

And drop the base URL: http://blogging.nitecruzr.net

Giving:
  • The Home page: /
  • A post: /2012/12/redirecting-any-url-in-your-blog-to.html
  • A static page: /p/topics.html
  • A label search: /search/label/Redirecting
  • A shortcut URL: /topics

Having developed the proper "From" and "To" values, adding a "Custom Redirects" entry is simple enough.

Having setup a useful complement of Pages, and redirected the Home page, you may wish to remove the "Home" page tab. Just edit the Pages gadget, using the dashboard Layout wizard, or the on blog quick edit icon - not the dashboard Pages wizard - and de select the "Home" page.

A simple example, showing the result, may be seen in my demonstration blog, Home Page Redirected To Label Search.
From: /
To: /search/label/Home%20Page

You may also wish to remove the "Showing posts with label ..." notice, if you like a cleaner display. In my demonstration blog (mentioned above), I did not do this - to make my examples more obvious.

The possibilities here are endless. Just use common sense - and again, note the limits on redirection.

Click here, for instructions. Note again, that the actual address, displayed in the browser address window, will not change.

>> Top

No comments:

Post a Comment