M
M
Multigame2016-04-10 19:40:03
Apache HTTP Server
Multigame, 2016-04-10 19:40:03

How to set up forwarding?

Good afternoon.
Please tell me how to make a 301 redirect of requests to test1.ru/dir1/
At the same time, leave requests of the format test1.ru/dir1/dir12/ , test1.ru/dir1/* without a redirect

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Azazel PW, 2016-04-11
@azazelpw

You have a global approach. Make a redirect via .htaccess and the redirect must be done by the server itself.
Isn't it easier through the header in the code itself?
php header redirect 301
something like this
if ($_SERVER['REQUEST_URI'] = 'test1.ru/dir1/ ') {
header("Location: / ");
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question