Answer the question
In order to leave comments, you need to log in
How to remove duplicate pages in this case through 404 or redirect???
Hello! If someone understands, can you tell me whether the general structure that removes duplicate pages is adequately made for me? I don't know much about this myself.
ErrorDocument 404 /err404.php
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^index$|\.php - [L,R=404]
RewriteRule ^([^.?]+)$ %{REQUEST_URI}.php [L]
Answer the question
In order to leave comments, you need to log in
R=404
??? Redirect with code 404?) 404 - this means that the document was not found. In your case, it is found, but has different addresses. Therefore, it would be more logical to send a 301 redirect from all addresses of the document to its canonical address.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question