admin avatar

Openlitespeed /litespeed 常用的伪静态(rewrite)规则大全

🕟 by admin





Openlitespeed /litespeed 常用的伪静态(rewrite)规则大全

默认WordPress规则:

1
2
3
4
5
6
7
8
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^/index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

重定向到HTTPS:

1
2
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.your-domain.com/$1 [R,L]

将www重定向到HTTPS:

1
2
RewriteCond %{HTTP_HOST} ^www\.your-domain\.com
RewriteRule (.*) https://your-domain.com/$1 [R=301,L]

Drupal 8:

1
2
3
4
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^/ index.php [L]

Laravel:

1
2
3
RewriteRule . /laravel/public/index.php [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f





💘 相关文章

写一条评论

Based on Golang + fastHTTP + sdb | go1.18.3 Processed in 1ms