【发布时间】:2016-11-11 02:19:39
【问题描述】:
我想将子文件夹和所有内容重定向到根域。
例如:
http://www.example.com/ubb/ 将重定向到http://www.example.com
我的服务器配置如下:
server {
listen 80 default_server;
root /home/vishant/devcenter/wava-v1.1/HTML;
index index.html index.htm;
# Make site accessible from http://localhost/
server_name baetter.l;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
#proxy_pass "http://127.0.0.1:3000";
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
}
我发现使用 htaccess here 解决了类似的问题
但是我如何在 nginx 中实现呢??
【问题讨论】:
标签: nginx url-rewriting nginx-location