-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.htaccess
25 lines (22 loc) · 892 Bytes
/
.htaccess
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<IfModule mod_rewrite.c>
RewriteEngine on
SetEnvIf Authorization ^(.*) HTTP_AUTHORIZATION=$1
SetEnvIf Content-length ^(.*) HTTP_CONTENT_LENGTH=$1
SetEnvIf Content-Type ^(multipart/form-data)(.*) RESTFUL_MULTIPART_TYPE=$1$2
RequestHeader set Content-Type multipart/restful-form-data env=RESTFUL_MULTIPART_TYPE
SetEnvIf Content-Type ^(.*) HTTP_CONTENT_TYPE=$1
#非www 301转跳到www
#如果输入的是下面是域名将自动跳转到www域名上
RewriteCond %{HTTP_HOST} ^(ping-qu.com)$ [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
#如果输入的是上面是域名将自动跳转到www域名上
#默认访问/
RewriteRule ^index.html$ / [R=301,L]
#运行访问公共目录
RewriteCond $1 !^(wx|admin|static|robots\.txt|index\.php)
RewriteRule ^(.*)$ /index.php/$1 [L]
#404设置 判断目录和是否存在来重定义url
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^$ /index.php/$1 [L]
</IfModule>