#RewriteCond :重新条件
#RewriteRule : 重写规则
# .htaccess文件中的规则会以它们出现的顺序被处理

<IfModule mod_rewrite.c>
RewriteEngine on

#RewriteRule ^user/(\w+)/?$ user.php?id=$1
RewriteRule ^user/([a-zA-Z0-9]+)/?$ user.php?id=$1

#禁止*.php地址直接访问页面
RewriteCond %{THE_REQUEST} (\w+)\.php
RewriteRule ^(\w+)\.php - [F] #403 Forbidden

</IfModule>

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-28
  • 2021-11-29
  • 2022-12-23
  • 2022-12-23
  • 2022-01-12
  • 2021-12-25
猜你喜欢
  • 2021-06-15
  • 2021-05-15
  • 2021-06-30
  • 2022-12-23
  • 2022-12-23
  • 2021-08-15
相关资源
相似解决方案