apache
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
nginx
h5目录下
location /h5{
if (!-e $request_filename){
rewrite ^/(.*) /h5/index.html last;
break;
}
}
web目录下
location /web{
try_files $uri $uri/web /web/index.html;
}
单独
location /{
try_files $uri $uri/ /index.html;
}
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last; break;
}
}