Method for implementing 301 permanent redirection in Apache

Viewed 5

I want to redirect all cnop.net to www.cnop.net. At the same time, following Google's advice, using server-side 301 redirection is the best way to ensure that users and search engines are directed to the correct webpage. A 301 status code indicates that a webpage has been permanently migrated to a new location.
The following is a method for implementing 301 permanent redirection in Apache, which requires permission to access the server's. htaccess file.

The code is as follows, just upload it to the website root directory:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^cnop.net$
RewriteRule ^(.*)$  http://www.cnop.net/ $1 [R=301,L]
0 Answers