當使用如何刪除後附加斜槓警予
Yii::app()->createUrl('/page/');
它additing額外的尾部斜槓的URL LIKE http://www.sitename//和http://www.sitename//page
,我需要排除兩個斜槓,應用程序URL經理是跟着,
'urlManager' => array(
'urlFormat' => 'path',
'showScriptName' => false,
'urlSuffix' => '/',
'rules' => array(
'site/news_letter_unsubsubscribe/<id:\w+>' => 'site/news_letter_unsubsubscribe',
'page/<id:[\w\-]+>' => 'page/index/',
'site/blog_detail/<id:[\w\-]+>' => 'site/blog_detail',
'location/<id:[\w\-]+>' => 'location/index',
'auth/partner_detail/<id:[\w\-]+>' => 'auth/partner_detail',
//'tour/tour_detail/<id:\w+>/<date:\w+>'=>'tour/tour_detail',
'activity/activity_detail/<id:[\w\-]+>' => 'activity/activity_detail',
'activity/compare_detail/<id:[\w\-]+>' => 'activity/compare_detail',
'tour/tour_detail/<id:[\w\-]+>' => 'tour/tour_detail',
'tour/compare_detail/<id:[\w\-]+>' => 'tour/compare_detail',
'<controller:\w+>/<id:\d+>' => '<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
'<controller:\w+>/<action:\w+>' => '<controller>/<action>',
'auth/reset_password/<id:\w+>' => 'auth/reset_password',
'site/linkedin_login/<id:\w+>' => 'site/linkedin_login',
),
)
的.htaccess規則
RewriteEngine On
RewriteBase/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\?*$ index.php/$1 [L,QSA]
從urlManager刪除urSuffix「/」,並給它一個嘗試。 – TNC
不,不是因爲回覆我不是這個問題 – TED