Answer the question
In order to leave comments, you need to log in
How to replace example.com/index.php/library with example.com/library?
Hello !
There is a site on yii 1.1 in which there are several modules
For example
example.com/index.php/library -- library
example.com/index.php/service -- something It is
necessary to be able to get to the places described above by shortened url
example. com/library -- library
example.com/service -- something
In general, how to remove Index.php? Website in yii, apache.
Tried directions from internet, doesn't work.
Thanks in advance,
Almik
Answer the question
In order to leave comments, you need to log in
Already discussed a hundred times. Learn
the materiel
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'rules'=>array(
// стандартное правило для обработки '/' как 'site/index'
'' => 'site/index',
// это пример добавления который заработал
//'secondcontroller/<action:.*>'=>'secondcontroller/<action>',
'user/<action:.*>'=>'user/<action>',
//'<action:.*>'=>'site/<action>', //закомментил а то глючило с ним
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
Options Includes FollowSymLinks
#hide index.php
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
The very first link in Google gives the answer: yiiframework.ru/forum/viewtopic.php?t=3264
1) From the beginning, look in the Apache settings to see if the AllowOverride All property is enabled
2) in the virtual host settings, add:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\?*$ index.php/$1 [L,QSA]
urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question