25 lines
765 B
ApacheConf
25 lines
765 B
ApacheConf
<IfModule mod_rewrite.c>
|
|
Options +FollowSymlinks -Multiviews
|
|
RewriteEngine On
|
|
DirectoryIndex index.html index.php
|
|
|
|
# API 请求 -> ThinkPHP
|
|
RewriteCond %{REQUEST_URI} ^/api [NC]
|
|
RewriteCond %{REQUEST_FILENAME} !-f
|
|
RewriteCond %{REQUEST_FILENAME} !-d
|
|
RewriteRule ^(.*)$ index.php?s=/$1 [QSA,L]
|
|
|
|
# 管理后台 SPA
|
|
RewriteCond %{REQUEST_URI} ^/admin [NC]
|
|
RewriteCond %{REQUEST_FILENAME} !-f
|
|
RewriteCond %{REQUEST_FILENAME} !-d
|
|
RewriteRule ^admin(?:/.*)?$ admin/index.html [L]
|
|
|
|
# 会员端 SPA
|
|
RewriteCond %{REQUEST_FILENAME} !-f
|
|
RewriteCond %{REQUEST_FILENAME} !-d
|
|
RewriteCond %{REQUEST_URI} !^/api [NC]
|
|
RewriteCond %{REQUEST_URI} !^/admin [NC]
|
|
RewriteRule ^(.*)$ index.html [L]
|
|
</IfModule>
|