I am new with Yii2 framework. I am working on web which needs SEO URl, it means that one URL should have one content. If I use standard route
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'enableStrictParsing' => true,
'matchValue' => true,
'class' => 'codemix\localeurls\UrlManager',
// List all supported languages here
// Make sure, you include your app's default language.
'languages' => [ 'cs', 'en', ],
'rules' => array(
'<action:\+w>' => 'site/<action>'
),
],
I have same content on
/
and
/index
and
/index.php/
Is there a solution for redirecting duplicate urls to only one.
/ -> no redirect
/index -> redirect to /
/index.php -> redirect to /
/about -> no redirect
/site/about -> redirect to /about
/index.php/site/about -> redirect to /about
It is not the problem, I have a problem that pages are accessible on two URLs. Url builder builds right links without "index.php", but if I write manually "index.php" to URL, it works without redirecting to "/"
Did you try link on my prev post. One content is accessible on two URLs
demo.easyiicms.com/index.php // I want to redirect this to demo.easyiicms.com/
demo.easyiicms.com/