D
D
Dmitry2014-07-07 10:25:23
htaccess
Dmitry, 2014-07-07 10:25:23

How to redirect specific urls from a subdomain to the main domain?

Hello. There is a url like subdomen.site.com/page/. You need to redirect to www.site.com/page/ in .htaccess.
Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Petrikov, 2014-07-07
@RicoX

More or less like this

RewriteEngine On
RewriteRule ^subdomen.site.com\/page/(.+)$ http://www.site.com/page/$1 [R=301,L]

O
Oleg Krasnov, 2014-07-07
@OKrasnov

Like this:

RewriteCond %{HTTP_HOST} ^subdomen.site.com$ [NC]
RewriteRule (.*) http://www.site.com/$1 [L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question