I have a question about creating a .htaccess file.

Asked 1 years ago, Updated 1 years ago, 51 views

I'd like to redirect the mirror site to a legitimate site with .htaccess.
When I created it in the htaccess editor, I was told that the answer in the Search Console forum would not work.

<Files~"^\.(htaccess|htpasswd)$">
deny from all
</Files>
Redirect permanent https://projects.wordpressrocket.jp/kurumajoho/ https://kurumajoho.com/
order deny, allow

Mirror site=https://projects.wordpressrocket.jp/kurumajoho/
Genuine site=https://kurumajoho.com/
That's it.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule^projects.wordpressrocket.jp/kurumajoho/$ https://kurumajoho.com/ [R=301,L]
</IfModule>

I also looked this up on the internet and made it.
Regarding the transfer source URL that was created for relocation during custom production, do you not need the /kurumajoho/ directory part?
Redirect destination URL in .htaccess

When I looked it up on the Internet, there were many descriptions and I don't know.
I want to create the correct htaccess file.
I am very sorry to ask you such an amateurish question, but I look forward to your reply.

.htaccess

2022-09-30 17:31

2 Answers

Doesn't it work like this?

#BEGIN WordPress
RewriteEngine On
RewriteBase/
RewriteRule^/kurumajoho/$https://kurumajoho.com/ [R=301,L]
# END WordPress


2022-09-30 17:31

The source is the path, not the URL.

Redirect permanent/kurumajoho/https://kurumajoho.com/


2022-09-30 17:31

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.