Book Image

concrete5 Beginner's Guide

Book Image

concrete5 Beginner's Guide

Overview of this book

Table of Contents (19 chapters)
concrete5
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – enabling pretty URLs


Follow these steps to get rid of the index.php from you URLs:

  1. Log in to concrete5.

  2. Click on the Dashboard button in the top-right corner.

  3. Select Sitewide Settings in the navigation.

  4. Check Enable Pretty URLs and hit Save, you should see the following screen:

  5. concrete5 should have created a file called .htaccess in the root of your website. This is the file where the rewrite rules are stored which remove index.php from the URLs.

    You can now open a subpage by entering http://localhost/about/—the index.php is gone.

What just happened?

Congratulations, you're done! concrete5 is running and you've also activated some options to improve the behavior of concrete5.

You've enabled pretty URLs which uses the Apache mod_rewrite module to rewrite URLs. In case you'd like to know more about this Apache feature this is the official documentation:

http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html

.htaccess is a configuration file most commonly used by Apache to configure Apache modules on a directory level. It's a simple text file you can open with any text editor of your choice. If you haven't worked with Apache before, the content might be a bit confusing but concrete5 took care of it. You shouldn't have to modify anything on your own in this file.

Note

Pretty URLs can also be used with Microsoft IIS but you need to install a rewrite filter first.

If you want to try it on your own, you can find a solid and free rewrite filter at this address: http://iirf.codeplex.com/.