Answer the question
In order to leave comments, you need to log in
PHP - How to make a 301 redirect from a domain to a subdomain?
Good afternoon, I'm not strong in regular expressions, can you help me, I need to redirect from the Joomla main page to a subdomain that contains a neat yii site. Something like:
Leave domen.kz and go to poddomen.domen.kz if you are on domen.kz. And preferably, they are interested in 2 options -
1. Regular, so that the redirect occurs from all pages
2. To only from the main page.
This option did not work:
Redirect 301 www.domen.kz catalog.domen.kz
Redirect 301 www.domen.kz/ catalog.domen.kz
Redirect 301 domen.kz/ catalog.domen.kz
Redirect 301 www.domen.kz catalog. domain.kz
Redirect 301 www.domen.kz catalog.domen.kz
Redirect 301 domain.kz catalog.domen.kz
Answer the question
In order to leave comments, you need to log in
And here php if it is for apache judging by your rules
in .haccess we write
RewriteEngine on
Options +FollowSymLinks
RewriteCond %{HTTP_HOST} ^www\.domen\.kz
RewriteRule ^(.*)$ http://domen.kz/$1 [R=301,L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question