blob: 3282b7f0c45d76d3de737d0e9673f95ce4f5da90 (
plain)
1 Creating_Search_Engine_Optimized_Drupal_URLS
2 ============================================
3 :author: Aaron Ball
4 :email: nullspoon@iohq.net
5
6
7 == {doctitle}
8
9 A big piece to search engine optimization is how your URLs are structured. A
10 ways back, I was talking to a buddy of mine who does SEO for a living and he
11 suggested that I use WordPress' URL rewrites to make my URLs friendlier. I went
12 ahead and set my blog up for a 'yyyy/mm/dd/title' format and it did wonders for
13 my search rankings. Recently however, I moved to Drupal which sadly does not
14 automagically create the friendly aliases to your posts. There is good news
15 though. In typical Drupal fashion, there's a module for that (kind of like
16 "there's an app for that") and it is very customizable.
17
18 To set yourself up with article urls (or blog urls) that autoalias with a
19 format that you want, you need to grab two modules. First you need the
20 *Pathauto* module, and that depends on the *Token* module. Before we continue,
21 I'm writing this to fit a Drupal 7 scenario, so likely some of the stuff will
22 be in a slightly different place if you're running 6 or 5.
23
24 Now, once you have those enabled, head on over to the Configuration->URL
25 aliases section of your Drupal site. Once there, select the pattern tab.
26
27 Where we put our aliasing string here depends on whether your writing your
28 content as a blog or an article content type.
29
30 If you blog in article content types, put the following string in the
31 *Pattern for All Article Paths* field:
32
33 ----
34 [current-date:custom:Y]/[current-date:custom:m]/[current-date:custom:d]/[node:title]
35 ----
36
37 If you blog in blog format, put the following string in the *Pattern for all
38 Blog entry paths* field:
39
40 ----
41 [current-date:custom:Y]/[current-date:custom:m]/[current-date:custom:d]/[node:title]
42 ----
43
44 image:files/pathauto-alias-strings0.jpg[height=300]
45
46 Keep in mind that I formatted those strings for blog entries. If you're doing
47 basic pages or something like those, you likely won't want the format I used in
48 this article. Just expand the *Replacement Patterns* section in your patterns
49 tab to see what other options you have for formatting those URLs.
50
51
52 Category:Drupal
53
54
55 // vim: set syntax=asciidoc:
|