www or no www canonicalization
Posted: Mon Jan 20, 2025 4:12 am
This only changes
the directory name, so if the file name has been changed, a 404 error will occur, so be careful.
Finally, upload it to the server. Be careful of the scope of investors mailing lead the settings when uploading. Please refer to page-by-page redirection
for specific uploading methods .
Next, let's look at how to normalize URLs with or without www.
As before, first create a .htaccess file: Open
Notepad , name it .htaccess , and save it as "All Files" type .
Next, write the redirect instructions in this file.
To 301 redi URLs with www,
RewriteEngine on
RewriteCond %{HTTP_HOST} ^( aaa \.com)(:80)? [NC]
RewriteRule ^= 301 ,L]
the directory name, so if the file name has been changed, a 404 error will occur, so be careful.
Finally, upload it to the server. Be careful of the scope of investors mailing lead the settings when uploading. Please refer to page-by-page redirection
for specific uploading methods .
Next, let's look at how to normalize URLs with or without www.
As before, first create a .htaccess file: Open
Notepad , name it .htaccess , and save it as "All Files" type .
Next, write the redirect instructions in this file.
To 301 redi URLs with www,
RewriteEngine on
RewriteCond %{HTTP_HOST} ^( aaa \.com)(:80)? [NC]
RewriteRule ^= 301 ,L]