How to setup a redirection from root domain name to a sub folder?

Maxoq

Well-known member
Joined
Feb 25, 2015
Messages
367
Best answers
0
Ratings
47 1
Points
28
#1
Hi there,

How can I setup a redirection from root domain name to a sub folder?

For example:
when a visitor enter my website at example.com it will be redirected to example.com/blog/

At this time, I have not got a homepage hence I would like to run a blog first, and it will currectly use as homepage of my website. When I have a homepage, I can remove this redirection and run homepage and blog as separated pages.

Thanks
 

VirtuBox

Global Mod
Staff Member
Joined
May 3, 2016
Messages
1,543
Best answers
4
Ratings
411 13
Points
83
#2
Hello,
with Plesk, you can set the following code in Apache & Nginx settings > Additional Nginx directives

NGINX:
location =/ {
    return 302 https://$host/blog/;
}
You can also use a 301 redirection instead of the 302 in my example, but if it's a temporary redirection, I think a 302 is enough.
 
Newer Threads
Latest Threads
Replies
1
Views
22
Replies
1
Views
24
Replies
0
Views
19
Replies
2
Views
31

Latest postsNew threads

Latest Hosting OffersNew Reviews

Sponsors

Latest Blog ArticlesMost Viewed Threads

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top