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

Thursday, Oct 29, 2020 | 1 minute read | Updated at Thursday, Oct 29, 2020

@

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

默认WordPress规则:

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^/index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

重定向到HTTPS:

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

将www重定向到HTTPS:

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

Drupal 8:

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

Laravel:

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

© 2018 - 2026 vpslala

🌱 Powered by Hugo with theme Dream.