Hi guys
I tried to have clean URL on mac with XAMPP and it works well.
I am trying to have clean url in IIS 6 on a windows machine? Does anyone have an idea?
Thank you
Page 1 of 1
Clean URL IIS 6
#3
Posted 09 March 2012 - 12:31 PM
ignoring the fact that this is in totally the wrong sub forum. This isn't a Yii issue, you just need to learn how to rewrite urls with IIS, http://blogs.msdn.co...ite-on-iis.aspx
#4
Posted 09 March 2012 - 02:26 PM
Thank you. I read that article but it does not say how to rewrite a rule.
I tried to do something like the attachment but it didnt help.
That's what i have in config/main.php
I tried to do something like the attachment but it didnt help.
That's what i have in config/main.php
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=> false,
'rules'=>array(
'' => '/site/index',
'About' => array('site/page', 'defaultParams' => array('view' => 'about')),
'Menu' => array('site/page', 'defaultParams' => array('view' => 'menu')),
'Contact'=>'/site/contact',
'List'=>'user/index',
'Create'=>'user/create',
'Manage'=>'user/admin',
'login'=>'/site/login',
'logout'=>'/site/logout',
),
),
Attached File(s)
-
Untitled.png (169.27K)
Number of downloads: 32
#5
Posted 09 March 2012 - 03:17 PM
it's not something you can solve with PHP or Yii, you need to configure IIS correctly.
#6
Posted 09 March 2012 - 03:20 PM
Thank you. I know it is not Yii issue but I was hoping someone had had the same problem and I can get help from him/her
#7
Posted 12 March 2012 - 11:48 AM
I am able to use rewrite rules which directs me to a correct url but somehow the same urlManagr does not work in IIS for a windows machine/
For example
changes to
and here is my urlManager
any idea what when wrong?
For example
http://localhost/user/index.php?r=user/create
changes to
http://localhost/user/Create
and here is my urlManager
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=> false,
'rules'=>array(
'' => '/site/index',
'About' => array('site/page', 'defaultParams' => array('view' => 'about')),
'Menu' => array('site/page', 'defaultParams' => array('view' => 'menu')),
'Contact'=>'/site/contact',
'List'=>'user/index',
'Create'=>'user/create',
'Manage'=>'user/admin',
'login'=>'/site/login',
'logout'=>'/site/logout',
),
),
any idea what when wrong?
#8
Posted 13 March 2012 - 09:39 AM
Anyone knows why on a PC with XAMPP clean url does not work the same way it works on a mac? On a MAC I get a url as simple as
Any idea how to remove that index.php in the middle?
Thanks
localhost/user/Createbut on a PC it gives me
localhost/user/index.php/Create
Any idea how to remove that index.php in the middle?
Thanks
#9
Posted 31 May 2012 - 07:47 AM
This is my config
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'caseSensitive'=>false,
'rules'=>array(
'' => '/site/index',
'<action:(index|page|contact|login)>'=>'site/<action>',
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
.htaccess file
<IfModule mod_rewrite.c>
# Enable mod_rewrite engine
RewriteEngine on
RewriteBase /sslprototype
# 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
RewriteRule site/(.*) /$1 [L,NS]
</IfModule>
I hope it solves your problem
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'caseSensitive'=>false,
'rules'=>array(
'' => '/site/index',
'<action:(index|page|contact|login)>'=>'site/<action>',
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
.htaccess file
<IfModule mod_rewrite.c>
# Enable mod_rewrite engine
RewriteEngine on
RewriteBase /sslprototype
# 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
RewriteRule site/(.*) /$1 [L,NS]
</IfModule>
I hope it solves your problem
#10
Posted 17 July 2012 - 10:48 PM
It's not seems like any problem with PHP or Yii. Something wrong with IIS, try to configure IIS correctly.
Share this topic:
Page 1 of 1

Help












