Typecho启用Rewrite功能
添加文件<.htaccess>包含以下内容:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>

禁止访问文件夹
添加文件<.htaccess>包含以下内容:

<Directory /document/>
Order Deny,Allow
Deny from all
</Directory>

强制Https
添加文件<.htaccess>包含以下内容:

RewriteEngine on
RewriteCond  %{HTTPS} !=on
RewriteRule  ^(.*) https://%{SERVER_NAME}$1 [L,R]

禁止ip访问
在<httpd.conf>配置文件中加入以下内容:

NameVirtualHost 58.87.111.129
<virtualhost *:80>
    ServerName  58.87.111.129
    <Location />
        Order Allow,Deny
        Deny from all
    </Location>
</virtualhost>
Last modification:November 4th, 2018 at 05:58 pm
If you think my article is useful to you, please feel free to appreciate