D
D
Dmitry2013-09-20 14:46:09
Apache HTTP Server
Dmitry, 2013-09-20 14:46:09

How to redirect all requests to another site in apache?

Hello dear.
There is a domain name site.ru, all requests are needed, such as
site.ru
site.ru/sdfgdfg
site.ru/1/1/1
, etc. redirect to the VKontakte group vk.com/group . I did Redirect permanent / vk.com/group/

in the Apache site config, but this redirects the site.ru/1/1/1 request to vk.com/group/1/1/1 and VKontakte, respectively, responds with a 404th. As I understand it, it is more competent to do this with a 301st redirect to mod_rewrite, but then what should the RewriteRule line look like correctly?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Kouznetsov, 2013-09-20
@seventh

RewriteEngine on
RewriteBase /
RewriteRule ^(.*) http://vk.com/group/ [R=301,L]
look like this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question