Latest News

Redirecting Any URL In Your Blog, To Another URL

In late 2011, 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.

You can only redirect within the 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 can redirect the blog home page display, within the blog.

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

You can redirect one specific post URL reference, within the blog.

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

You can make a shorter URL, for easy access inside or outside the blog.

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

And here is a demonstration of a custom redirect, to my magic post about custom redirects.

From: /SimpleURL
To: /2013/01/blogger-magic-redirecting-url-in-your.html

Pick any two URLs, in the same blog.

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.

Make a cleaner "menu bar" display, if you redirect the home page.

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

There are some subtle limitations.

Note that a label search displays a fixed number of 20 posts, regardless of the "Show at most" / "Number of posts on main page" setting. If this is a problem for your blog, you can explicitly set maximum label search size, using the "max-results" modifier in the "To" value.

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. Note again: by design, you cannot specify the base URL - so all redirecting will be within the blog itself

Other than the latter limitations, though, this is a pretty powerful feature - when you understand the design.

No comments:

Post a Comment

Contact Us

24x7 online , we happy to answer you
tamilcypc@gmail.com

Disclaimer

This Blog and its TUT's are intended for educational purposes only, no-one involved in the creation of this TuT may be held responsible for any illegal acts brought about by this Blog or TuT.



Featured Post

Custom Domains And HTTPS Redirection Code