要配置.htaccess伪静态规则,您需要在.htaccess文件中添加Rewrite规则。以下是一些常用的.htaccess伪静态规则示例:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
RewriteEngine On
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^([^\.]+)\.html$ $1.php [NC,L]
RewriteEngine On
RewriteRule ^old-url$ /new-url [R=301,L]
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
请根据您的需求选择适合的规则,并将其添加到.htaccess文件中。请注意,在配置之前,您需要确保服务器上已启用了mod_rewrite模块。