分页: 1 / 1

apache2的URL重写功能的问题

发表于 : 2017-06-07 15:16
张奇怪
现在用ubuntu作服务器自己搭了个网站, 然后想用apache2的url重写功能做伪静态话, 项目的.htaccess文件的内容如下:

代码: 全选

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond $1 !^(index\.php|static|min|alipay|weixinpay|pingpp|upload|images|Batch_trans_notify-PHP-UTF-8|robots\.txt)
RewriteRule ^(.*)$ index.php/$1
RewriteRule ^test/?$ welcome/index [R=301]
</IfModule>
本来想在访问http://waimao.ubuntu.com/test时301重定向到http://waimao.ubuntu.com/welcome/index的, 但是它会重定向到http://waimao.ubuntu.com/var/www/html/welcome/index下, 请问是哪里出了问题呢???