首页 > 解决方案 > 我写了一个 .htaccess RewriteRule 但它不工作

问题描述

我想:

http://localhost/electionhope/blog.php?blog_id=3

发挥作用:

http://localhost/electionhope/blog/3

RewriteRule ^blog/(\d+)$ blog.php?blog_id=$1 [NC, L]

注意:未定义索引:第 1 行 C:\wamp64\www\electionhope\blog.php 中的 blog_id

blog.php 第 1 行:

<?php $blogID = $_GET['blog_id']; ?>

标签: .htaccessmod-rewriteexpression

解决方案


推荐阅读