1.

How You Can Remove Index.php From Your Application Url ?

Answer»

Steps to remove index.php from your APPLICATION url.

Step 1: First configure your Yii-application CONFIGURATION file like below code

.....
'urlManager'=>array(
'urlFormat'=>'path', //mandatory
'showScriptName'=>false, //mandatory
'urlSuffix'=>'.html', //not mandatory
......
),
....

Step 2: Enable apache rewrite ENGINE. To enable rewrite engine type the following command in your TERMINAL (Ubuntu ).

a2enmod rewrite // to enable rewrite engine
#Restart apache2 after
/etc/init.d/apache2 restart
OR
service apache2 restart

Step 3: Then, if you'd like, you can use the following .htaccess file in your application folder where index.php exists

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

Thats all the 3 steps to remove index.php from the URL.

Steps to remove index.php from your application url.

Step 1: First configure your Yii-application configuration file like below code

.....
'urlManager'=>array(
'urlFormat'=>'path', //mandatory
'showScriptName'=>false, //mandatory
'urlSuffix'=>'.html', //not mandatory
......
),
....

Step 2: Enable apache rewrite engine. To enable rewrite engine type the following command in your terminal (Ubuntu ).

a2enmod rewrite // to enable rewrite engine
#Restart apache2 after
/etc/init.d/apache2 restart
OR
service apache2 restart

Step 3: Then, if you'd like, you can use the following .htaccess file in your application folder where index.php exists

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

Thats all the 3 steps to remove index.php from the URL.



Discussion

No Comment Found