php - 使用 .htaccess 重写 URL(添加查询字符串)

标签 php html mysql .htaccess mod-rewrite

http://www.naissancebebe.com/index.php?fc=module&module=prenoms&controller=search&gender=boy

我想用 .htaccess 重写这个

http://www.naissancebebe.com/boy.php

所以这个查询字符串 "index.php?fc=module&module=prenoms&controller=search&gender=boy"添加到 .htaccess 文件中。

这是我的代码

#RewriteEngine On
RewriteRule ^boy.php /index.php?fc=module&module=prenoms&controller=search&gender=boy [L]

最佳答案

尝试:

Options -Multiviews
RewriteEngine On
RewriteRule ^boy\.php$ /index.php?fc=module&module=prenoms&controller=search&gender=boy [QSA,NC,L]

关于php - 使用 .htaccess 重写 URL(添加查询字符串),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33664075/

相关文章:

php - 如何将表单提交到两个不同的页面(不同时)?

php - 在 PHP 中自动刷新 MySQL 查询结果

javascript - HTML5 meter标签,使用JS改变渐变颜色

html - 如何让页脚元素位于页脚中间?

mysql - 遇到 EXISTS 和 GROUP BY 的问题

php - 比较数组与数据库,取消设置值,而不丢失偏移量?

php - mysql DB 不添加具有相似元素的行

php - PHP 中导出的反射类的格式?

php - 编辑成员(member)表格不更新数据库

css - 使用 CSS 调整 li 元素的大小