Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Htaccess file control of site-building SEO (301and static file permissions)

Shulou Source: shulou.com Published: 2022-06-01 08:17:40 11月07日 Update

htaccess control 301 directional

#Long domain names direct short domain names, weight one RewriteEngine onRewriteBase /RewriteCond %{http_host} ^www.mr8c.com [NC]RewriteRule ^(.*)$ http://mr8c.com/$1 [L,R=301]

This code controls the redirection of requests for www.mr8c.com domain name access to mr8c.com, enabling long domain names to be directed to short domain names, with weights unified to short domain names.

2 . Control static file foreign site access

RewriteEngine onRewriteBase /RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^ http://(www\.)? mr8c.com/.*$ [NC]RewriteRule \. (gif|jpg|png|js|css)$ - [F]

This code controls the termination of requests for domain names whose referral sources are not mr8c.com and not www.mr8c.com.

Tags: Domain name control code weight file static source unified site building permissions Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Shulou Tech Info MariaDB Apple macOS