YII 1 URL Management index.php remove



return array(
'urlFormat'=>'path',
    'showScriptName'=>false,
'rules'=>array(
  ----------
                  ----------
'sitemap.xml'=>'site/sitemapxml',
'np'=>'nepal/kahtmandu',
'in'=>'india',
'pk'=>'pakistan/lahor',
'jp'=>'japan/tokyo',
),
);


-------------------------------
using Method


public function actionIndex() {
$con = Yii::app()->request->url;
$trim = trim($con, '/');

print_r($trim);
}
------------------------
.htaccess
RewriteEngine on

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# otherwise forward it to index.php

RewriteRule . index.php

Share on Google Plus

About Ram Pukar

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment

0 comments:

Post a Comment