redirect root to subdirectory - best practice

Hey,

i want to redirect my root domain XXX.com to XXX.com/YYY.
i want let users to access all other pages like XXX.com/ZZZ and not redirected.

i tried both .htaccess and apache conf but didnt manage to make it work.

  1. what is the best solution?
  2. how do i do that?

thanks

2 Replies

It looks like what you want to do is create a redirect in Apache. We have a guide on doing this on our website:

Redirect URLs with the Apache Web Server

Essentially, in the Apache configuration, specifically the vhost file, you'll redirect users from one site to another. Should you be concerned about SEO, then you'll want to consider the type of redirect you're making. If this is a permanent move, then you'll want to do a 301 redirect. If this is just a temporary change, you'll want a 302.

thanks,
its half work, now every page i am visiting (not only the root) redirect me.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct