D
D
DoRcK2014-05-01 15:01:09
PHP
DoRcK, 2014-05-01 15:01:09

Redirect from domain to subdomain, how to implement on .htaccess?

Hello! You need to write an .htaccess file (PHP can be used) to redirect from the domen.ru domain to the subdomen.domen.ru subdomain. Please help. PS: I tried with my own methods, gave out Internal server error or cyclic redirects...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
m-haritonov, 2014-05-02
@DoRcK

RewriteEngine on
RewriteCond %{HTTP_HOST} ^domen.ru$
RewriteRule ^(.*)$ http://subdomen.domen.ru/$1 [R=301,L]

The line with RewriteCond can be removed if you want to redirect all requests received for processing by this .htaccess file.

D
demimurych, 2014-05-01
@demimurych

beget.ru/art_htaccess

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question