我有一个CMS制作的简单网站与漂亮的URL启用。我想重定向所有的非WWW流量到WWW网址,但不能似乎这样做,除非被重定向到WWW版本的网站,但没有漂亮的网址。
例如,我访问example.com/my-page并被重定向到www.example.com/index.php?page=my-page。真的,我想重定向到www.example.com/my-page。
我当前的.htaccess文件包含以下内容:
# Attempt to override some php settings, these settings may be helpful on some hosts if your
在Yii2中,我不能启用漂亮的url。
我的配置:
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
],
我的.htaccess:
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FI