时间:2021-07-01 10:21:17 帮助过:20人阅读
RewriteEngine On RewriteCond %{HTTP_USER_AGENT} (^$|FeedDemon|JikeSpider|Indy Library|Alexa Toolbar|AskTbFXTV|AhrefsBot|CrawlDaddy|CoolpadWebkit|Java|Feedly|UniversalFeedParser|ApacheBench|Microsoft URL Control|Swiftbot|ZmEu|oBot|jaunty|Python-urllib|lightDeckReports Bot|YYSpider|DigExt|HttpClient|MJ12bot|heritrix|EasouSpider|Ezooms) [NC] RewriteRule ^(.*)$ - [F]
Redirect 301 /a.html https://www.pazzn.com/b.html
RewriteEngine on RewriteRule ^(.*)$ http://www.pazzn.com/$1 [R=301,L]
Order deny,allow Allow from all Deny from 127.0.0.1
RewriteCond %{REQUEST_URI} /+[^\.]+$ RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ /$1 [R=301,L]
SetEnvIf Request_URI "/starry-night" allow_framing=true Header set X-Frame-Options SAMEORIGIN env=!allow_framing
RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http(s)?://(.+\.)?feiniaomy.com [NC] RewriteRule \.(jpg|jpeg|png|gif|bmp)$ - [NC,F,L]
总结:以上就是apache中.htaccess文件的常用几中设置的方法,但要注意的是,在编辑apache的.htaccess文件时,使用一些代码编辑器进行编辑。
.htaccess设置301跳转及常用技巧整理
标签:parse server number highlight line pytho iter 常用技巧 强制