Lesson 4ª

 

 

 

 

 

   

 

First Configuration: Permalink Settings

The next stop on a fresh WordPress install is found under "Settings" and "Permalinks".

By default, the URLs in WordPress are displayed something like: http://yoursite.com/?p=123

But wouldn't it be nicer to replace ?p=123 with the name and perhaps even the date of the post, letting your visitors and search engines think you have a neat organized directory structure and static files? Well not only is this nicer, nowadays it is a necessity when it comes to usability and getting ranked highly on search engines.

To create these false subdirectories in the URL we need to make a modification to the web server that fetches and returns the pages for the visitor. In most cases, and with most web hosts default settings, this can be done automatically by WordPress. But if not, it is a simple case of uploading a file to the root directory you originally uploaded WordPress into. We'll have a look at both possibilities, but first let's go through all the options.

Common settings

wordpressWordPress gives you five options for how you'd like your URLs to appear.

Default - the ugly standard

Day and name - by far most common, displaying the year, month and day of the post along with the post's title

Month and name - as above, but cutting out the day. Useful if you won't be posting every day, just perhaps once or twice a month

Numeric - similar to the ugly default. Good for search engines, but a human wouldn't be able to tell what the post was about by looking at the URL

Custom Structure - if none of the above work for you, you can make your own. The default value is /%year%/%monthnum%/%postname%/ - which would display the URL exactly the same as the "Month and name" option. Custom structures are useful only if you want to do something very specific, such as display the Post URL as http://yoursite.com/post-name/ (dangerous as it can interfere with a Page) or perhaps with the date and post name reversed such as http://yoursite.com/post-name/04/06/2010/ (also not recommended)

Let's select "Day and name" as it is probably the most useful.

Optional settings

By default, the URL for a Category called "pets" would be http://yoursite.com/category/pets/

and the URL for a Tag called "animals" would be http://yoursite.com/tag/animals/

Here you have the option to change the value of "category" or the word "tag" in those URLs. For example, some might prefer to call their Categories "sections" or their Tags "labels".

Saving the changes

With the changes made above, click "Save Changes". If that file that modifies the web server mentioned earlier already exists and WordPress is able to save your new settings into it, you're done. Visit the your blog, or refresh the page if you have it open, and see how the URLs have changed.

If it didn't work, you most likely received and error about your .htaccess file not being writable. WordPress would have then given you the code to copy and paste into the file manually. At this stage, you have three options.

wordpress

wordpress

  1. Ask your web host to make the .htaccess file in the root writable for WordPress.Then try the above again.
  2. Fire up your FTP client again (maybe going into its settings beforehand to make hidden files visible) and locating .htaccess and changing its permissions to 666. Then try the above again.
  3. Create a simple file on your computer called htaccess.txt, perhaps with Notepad. Paste the code WordPress provided you with into this file and save it. Upload the file to the root directory where you uploaded WordPress with your FTP client, then rename the file ".htaccess" (don't forget it starts with a ".").

With one of these options, you're permalinks will be set.