.htaccess - 我写了一个 .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']; ?>
解决方案
推荐阅读
- python - 如何在 Python 中按字典的值正确排序?
- css - 如何为轮播设置 100% 宽度?
- c - 如何在 POSIX 正则表达式中写负前瞻
- mysql - 使用节点 js 连接到 My Sql 会引发错误“连接 ECONNREFUSED 127.0.0.1:3306”
- php - 在 php 中使用 str_shuffle 生成 4 位数的密码,但有时会得到 3 位数的数字
- php - 在我通过 php 获取当前页面的代码之前,如何加载并准备好 HTML 页面?
- typescript - 如何为 vue 插件添加类型?
- vba - Delete specific number of rows from WORD table
- docker - Docker Swarm 过滤器、约束和调度策略
- python - 如何根据属于另一个 2D 列表的 1D 元素对 2D 列表中的元素进行分组/组合?