nginx URL从“裸”域重写到特定URL

r6vfmomb  于 2023-01-08  发布在  Nginx
关注(0)|答案(1)|浏览(126)

I need to redirect so when someone types https://mydomain.is to be redirected to https://mydomain.is/issues , I found directive how to do oposite , but not what I want. mydomain.is is site hosted in plesk.
预期输出:

https://mydomain.is --> https://mydomain.is/issues

找到了this guide,但当我单击"应用"时,它显示网站即将被删除

htrmnn0y

htrmnn0y1#

您是否尝试过使用mod_rewrite?例如,在.htaccess文件的开头插入以下内容:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^mydomain\.is$ [OR]
RewriteCond %{HTTP_HOST} ^www\.mydomain\.is$
RewriteCond %{REQUEST_URI} !^/issues
RewriteRule (.*)$ /issues/$1

相关问题