remove .php extention

In my elgg site

some page url has .php extention in address bar..

Can i remove that one?

  • It is possible to remove these. To do these you need to work with the page_handler to setup correct pages that link to views. Then *.php urls will not appear.

  • How to setup page_handler?

  • look in the start.php file of another plugin and see how it is done. It's easy to follow.

  • I use th page handler in Contact Importer Plugins Start.php but still it shows .php extention

    The code in the start.php is given below

     

    <?php

        /**
        * Contact Importer Plugin (using OpenInviter)
        *
        * @package ElggContactImporter
        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
        * @author Prashant Juvekar
        * @copyright SocialTrak, 2009
        * @link http://www.socialtrak.com
        */
       
        // Get config
        global $CONFIG;
       
        /**
         * Initialisation function
         */
         
         function contact_importer_init() {
         
            // Get config
            global $CONFIG;
           
            // Load the language file
            register_translations($CONFIG->pluginspath . "contact_importer/languages/");
       
            // Load menu for logged in users
            if ( isloggedin() ) {
                // Menu options
                global $CONFIG;
                if (get_context() == "friends" ||
                    get_context() == "friendsof" ||
                    get_context() == "collections") {
                        add_submenu_item(elgg_echo('contact_importer:plugin:name'),$CONFIG->wwwroot."mod/contact_importer/import",'import');
                    }
            }
           
            // Extend CSS
            extend_view('css', 'contact_importer/css');

        }
       
        // Make sure init is called on initialisation
        register_elgg_event_handler('pagesetup','system','contact_importer_init',1000);
            // Register a page handler, so we can have nice URLs
                    register_page_handler('contact_importer','contact_importer_page_handler');
       
    ?>