How can I change the path part of the node URL from ?q=node/2
into something more meaningsful. I want, for instance, to display it like this: ?q=Services
.
2 Answers
What you need is the pathauto module
The Pathauto module automatically generates URL/path aliases for various kinds of content (nodes, taxonomy terms, users) without requiring the user to manually specify the path alias. This allows you to have URL aliases like /category/my-node-title instead of /node/123. The aliases are based upon a "pattern" system that uses tokens which the administrator can change.
And you may also want to enable clean url to get rid of the q= in the url
To change a particular node, go to admin/config/search/path/add
Or go to the node and scroll down to url path settings and change it there. Make sure to uncheck generate automatic URL alias
-
This worked and I Preciate but how to change the existing ones because it can only change the new ones created after installation I will be so glad to get an answer Aug 15, 2013 at 8:41
-
Assuming you're using Drupal 7, to manually set a name for a module, all you need to do is to login as admin and navigate to Configuration → URL aliases. There you can create string aliases for nodes, so that node/2
is aliased to Services
.
For the nicest URLs, you should also enable Clean URLs on you site.
If you do not want to do this yourself, but instead want want names to be assigned to node paths automatically (based on some set of rules), then you can install and enable the PathAuto module.
?q=
at all? Why don't you simply turn on friendly addresses? It usually works out of the box. Then, go look for pathauto manuals.mod_rewrite
.