T
T
tareid2019-11-18 09:31:56
htaccess
tareid, 2019-11-18 09:31:56

How to edit .htaccess?

Hello, I want to redirect from one page https://old.com/noob/ to another page https://new.com/good. Found what can be done in .htaccess like this

Redirect 301 /https://old.com/noob /https://new.com/good

Is everything written correctly, in which part of htaccess should I copy this line?
Here is the htaccess itself
<Files "wp-login.php">
AuthType Basic
AuthName "User: word Password: word"
AuthUserFile /etc/apache2/AUTH/word
Require valid-user
</Files>

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dodo512, 2019-11-18
@dodo512

Redirect 301 /https://old.com/noob /https://new.com/good

So it won't work. The domain name does not participate in pattern matching there.
Or
If it is necessary to check the domain name.
RewriteCond %{HTTP_HOST} ^old\.com$
RewriteRule ^noob$ https://new.com/good [R=301,L]

T
tuxfighter, 2019-11-18
@tuxfighter

in any, except for the section

# BEGIN WordPress
....
....
# END WordPress

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question