Turning On SEF URLs

You can turn on SEF (search engine friendly) URL's on your site to eliminate the .php extension displayed in your address bar. Google and many of the other search engine providers consider static content to be more relevant that dynamically generated content. This makes sense, but as a result, virtually all content management systems and many shopping carts mimic providing static content via utilizing Apache mod rewrite directives to adjust the website's addresses. For whatever reason, the search engine providers have not realized that (A) almost all websites are now built in CMS's, blogs or forums, and (B) all of these systems have ways to generate SEF URL's, thus (C), the lack of a .php or .asp or whatever extension does not server as any indication that the content is static. Nevertheless, until Google and the other search engine providers change their practices, it is prudent to turn on SEF URL's

The first step is to uncomment all of the Apache mod-rewrite lines in the .htaccess file and upload it to your webroot folder by removing the hash marks ( # ) as shown below:

Options +FollowSymlinks

RewriteBase /

RewriteEngine on
RewriteRule ^/?(calendar|events|schedule).*(css/|scripts/|php/|manage/|ckeditor/|kfm/|connect/.*?|images.*?)([^/]+)$ /$2$3?$1 [R,NC,END]
RewriteRule ^(.*)(show_past|show_all|show_hebrew)/([A-Za-z0-9]+)/(.*)/?$ /$1$2=$3&$4 [NC]
RewriteRule ^/?(calendar|events|schedule)/(.*)&?$ /$1.php?$2 [NC,END]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php

Note: If you happen to create a calendar or events page with a different name other than "calendar", "events" or "schedule", you can add it in two locations in the above example. i.e. calendar|events|schedule|meetings

Then, in connect/config.php, change the following line:

define('SEF_URL', 0);


define('SEF_URL', 1);

and upload.

Finally, go into the menu items editor, select any menu and click Update to regenerate the sitemap.xml file.