Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-03-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report