apache2的URL重写功能的问题

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
张奇怪
帖子: 1
注册时间: 2017-06-07 15:04

apache2的URL重写功能的问题

#1

帖子 张奇怪 » 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下, 请问是哪里出了问题呢???
回复