URLs

Pages (templates) are organized in template groups. To access a template within a group you'll use this URL structure:

http://wwww.yoursite.com/index.php/template_group/templates/

For example: If you want to access the "comments" page within the "weblog" Template Group you'll use this:

http://www.yoursite.com/index.php/weblog/comments/

The Concept

Our goal was to make the URLs produced by ExpressionEngine search-engine friendly by default. In fact, there is almost no difference between URLs produced with the rewrite engine on or off. In order to accomplish this, the use of query strings was eliminated from the URLs.

Most dynamic systems use query strings. That is, URLs that look like this:

http://www.somesite.com/index.php?id=2&page=1

Notice the question mark and ampersand? Those are query strings. These enable dynamic systems like ExpressionEngine to fetch and display specific information. Query strings, however, are disliked by search engines, which prefer not to catalog dynamic information. For that reason, we've eliminated them completely, preferring to make our URLs segment driven.

URLs in ExpressionEngine look like this:

http://www.yoursite.com/index.php/weblog/archives/

Template groups and templates can be named anything you want. Your site index page can be renamed too, enabling you to create your own URL structure.

For example: You can rename your "index" page to "blog", then rename the default template group from "weblog" to "joe". Your weblog would then be at:

http://www.yoursite.com/blog/joe/

Naming your Main Page

You can name your site index.php file anything you want and the system will auto recognize the name. However, you will need to update the Admin > General Configuration settings within the Control Panel with the new name of your site index so that links will be rendered correctly.

Search-Engine Friendly URLs

In addition to simply being able to rename your main site file, you can also make your URLs even more friendly by eliminating the file extension from the file. In order to be able to do this you will have to instruct your web server to process the file as a PHP file even though it no longer has an extension.

Here are instructions for accomplishing this if your website is on a server running the Apache web server:

  1. Create a blank text file on your server in the same directory as your main site file. Name this text file ".htaccess" (without the quotes). Be sure to note the period at the beginning of the filename; this is very important.
  2. Place the following code in your new .htaccess file. Note: the word "index" needs to correspond to the name of your site index file.
  3. Important:
    You should confirm with your Host/server admin that the web server is set up to "AllowOverride". Otherwise the above commands may not actually take effect.

  4. Go to Admin > General Configuration in your Control Panel and update the name of your website index page so that the ".php" file extension is not on the name.