本文介绍了htaccess的重定向文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
所有,
我想重定向来 HTTP的所有流量:// mysite的/ 到的 HTTP:// mysite的/公共的文件夹中。目前我使用下面的.htaccess文件这样做的,它的工作原理为根目录。但是,如果我浏览到的http:// mysite的/应用,它不重定向,并显示目录列表。我希望所有的流量,无论它是什么文件夹重定向到的http:// mysite的/公共文件夹
I want to redirect all traffic that comes to mysite/ to mysite/public folder. Currently I am doing this using the below in an .htaccess file and it works for the root directory. But if I browse to mysite/application, it doesn't redirect and shows the directory listing. I want all traffic regardless of what folder it is to redirect to mysite/public folder
RedirectMatch permanent ^/*$ /public/
感谢
推荐答案试试这个 mod_rewrite的例如:
RewriteEngine on RewriteRule !^public/ /public%{REQUEST_URI} [L,R=301]更多推荐
htaccess的重定向文件夹
发布评论