I’ve verified that Apache & the mod_rewrite is working properply with the following snippet:
RewriteEngine On
Options +FollowSymLinks
RewriteRule ^test\.html http://www.google.com/? [R=301,L]
I’m using the advanced Yii2 template and my .htaccess reads:
RewriteEngine on
# 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
My url config:
object(yii\web\UrlManager)[58]
public 'enablePrettyUrl' => boolean true
public 'enableStrictParsing' => boolean false
public 'rules' =>
array (size=0)
empty
public 'suffix' => null
public 'showScriptName' => boolean false
public 'routeParam' => string 'r' (length=1)
public 'cache' => string 'cache' (length=5)
public 'ruleConfig' =>
array (size=1)
'class' => string 'yii\web\UrlRule' (length=15)
private '_baseUrl' => null
private '_hostInfo' => null
private '_events' (yii\base\Component) =>
array (size=0)
empty
private '_behaviors' (yii\base\Component) => null
Are you sure you’re setting up the config properly? I had some issues until I figured out how console/backend/frontend configs worked. (They inherit and override from common)