Syndicate

Feed

Simple redirect using the path module

You can use the path module to force a simple redirect in Drupal. Say you have a Drupal site with only one blog. When people access the page myWebsite.com/blog, you may actually want them to see the page at myWebsite.com/blog/x where x is the ONE blogger user hi-dee. (The page at myWebsite.com/blog has for title Blogs.) A simple redirect is achievable using the path module, part of the default Drupal distribution. Go to the page myWebsite.com/admin/build/path/add, and provide a new URL alias like so — replacing the number 1 with the uid of your lonesome blogger:

Adding a URL alias

This will work in Drupal 5 and Drupal 6. You may wonder if this is 'by design'. You're specifying an existing system path as 'Path alias', and Drupal thinks that this Drupal path is indeed an alias. In my opinion, this is more of a side effect than a bug — and it is a side effect you can take advantage of whenever you wish to 'condemn' certain Drupal roads to redirect your visitors to another page.

Last edited by Caroline Schnapp about 3 years ago.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <css> <html> <javascript> <mysql> <php> <span> <a> <b> <i> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <sup> <sub> <dd> <del> <blockquote> <img> <q> <p> <div>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <css>, <html>, <javascript>, <mysql>, <php>, <rails>, <ruby>.

More information about formatting options

CAPTCHA
I have to wonder if you're a human spammer or a machine, or less likely someone who cares to leave his or her thoughts behind.