Last update at :2024-06-18,Edit by888u
When we use WordPress to build a website, do we sometimes find that it can be opened by entering WWW or without WWW? In the past, when configuring, I used WWW directly or without WWW and only needed to set two unifications in the background. The address is fine. In the past few days, I encountered a website and found that this is not the case. Even if a WWW domain name is set and then opened with a domain name without WWW, it still does not work.
How to deal with it? Of course there are methods. We can use plug-ins to achieve this. In view of the principle of using less plug-ins, we still don’t use them. We can modify it in the htaccess file.
# BEGIN WordPressRewriteEngine OnRewriteBase /RewriteRule ^index\\\\.php$ – [L]RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule . /index.php [L]
#END WordPress
The above is the original content in our HTACCESS file, we need to add at the top:
RewriteEngine OnRewriteCond %{HTTP_HOST} ^laozuo.org [NC]RewriteRule ^(.*)$ https://www.laozuo.org/$1 [L,R=301]
Change the URL to your own. We need to pay attention to a problem. Do not update the fixed connection in the background. It will be restored after you update it. If it needs to be adjusted in time after the update.
Recommended site search: best US server, registration system, overseas server, php virtual space, 1g US virtual host, ip138 website query, domain name transfer, game server rental, registration-free virtual space, private server rental, < /p>
发表评论