E
E
EVOSandru62014-12-26 03:26:17
htaccess
EVOSandru6, 2014-12-26 03:26:17

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

2 answer(s)
E
Eugene, 2014-12-26
@Nc_Soft

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]

S
Sergey, 2014-12-26
@TsarS

mod_rewrite, кеш почистить

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question