L
L
Letum2013-11-06 16:52:15
htaccess
Letum, 2013-11-06 16:52:15

How to register a redirect for a subfolder with a change in domain and one of the folders?

I am writing .htaccess for one domain. We have a CMS where data access is implemented in this form:
mydomen1.ru/index.php/xxx/data
For those cases when xxx is equal to a certain value, I need to redirect to another domain with a change in xxx to yyy, of the form:
mydomen2.ru/index.php/yyy/data
respectively, while maintaining the subfolder structure. You also need to take into account that data can be empty, and there may or may not be a slash before it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WEBIVAN, 2013-11-06
@Letum

RewriteCond %{HTTP_HOST}  ^(www\.)?mydomen1.ru$  [NC]
RewriteRule ^index\.php/xxx(/.*)?$         http://mydomen2.ru/yyy$1 [L,R=301]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question