N
N
noxmag2020-05-26 16:25:15
htaccess
noxmag, 2020-05-26 16:25:15

How to redirect from page to page?

Good afternoon, tell me how to make a redirect from page to page on apach?
From https://site.com/en/old to https://site.com/en/new
Tried but doesn't work:

Redirect 301 /old https://site.com/en/new


RewriteCond %{REQUEST_URI} ^/en/old$
RewriteRule ^.*$ /en/new/? [R=301,L]

RewriteCond %{REQUEST_URI} ^https://site.com/en/old$
RewriteRule ^.*$ https://site.com/en/new/? [R=301,L]


Redirect permanent /en/old https://sitecom/en/new

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
Hanneman, 2020-05-26
@noxmag

Should work:
RedirectMatch 301 /en/old(.*) /en/new/$1
As for yours, it's not clear from the example if you have it.
RewriteEngine on
And it doesn't say anything about whether any directive in .htaccess works at all - .htaccess support is very often turned off by default in the settings.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question