A
A
Alexander Lebedev2015-12-08 09:10:24
htaccess
Alexander Lebedev, 2015-12-08 09:10:24

How to make a 301 redirect from a subdomain directory to a domain directory?

Now I do this:

RewriteCond %{HTTP_HOST} ^gidranty.ispytanie01.ru
RewriteRule ^(.*)$ http://ispytanie01.ru/vodosnabzhenie/$1 [L,R=301]

Everything works, but I need to clarify the task. If a person types "gidranty.ispytanie01.ru/spb" then I need to translate him to "ispytanie01.ru/spb/vodosnabzhenie".
I have tried something like this:
Redirect 301 http://gidranty.ispytanie01.ru/spb http://ispytanie01.ru/spb/vodosnabzhenie

But without much success. I would be grateful for advice.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Lebedev, 2015-12-08
@sortarage

gidranty.ispytanie01.ru/spb/vodosnabzhenie translates to ispytanie01.ru/vodosnabzhenie/spb/vodosnabzhenie. That is, it seems close, but dregs :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question