天天看点

alias rewrite 后出现404,应设置RewriteBase参数

Alias /mytest /www/mytest
<Directory /www/mytest>
AllowOverride all
Order allow,deny
Allow from all
</Directory>
           

为保证正常访问

需要在.htaccees文件里加入

RewriteBase /mytest
           

如下

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1 [L]
RewriteBase /mytest