如何利用.htaccess文件对PHP网站或文件进行伪静态处理

2025-05-14 12:31:08
推荐回答(1个)
回答1:

在.htaccess中添加
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{QUERY_STRING} ^ep=(.+)

RewriteRule ^(\/?)$ index.php
RewriteRule ^index.html$ index.php
RewriteRule ^news-([0-9]+).html$ news.php?pid=$1