.htaccess - 我希望仅使用 .htaccess 文件为我的 URL 重写 URL
问题描述
我的网址是
http://127.0.0.1/public_html/organisation/home/index.php?page=Your-Profile
但我希望我的 url 看起来像这样只使用 .htaccess:-
http://127.0.0.1/public_html/organisation/home/Your-Profile
我想使用 .htaccess 文件删除index.php?page=
请帮我..
解决方案
您可以删除/index.php
引擎默认情况下假定/设置的,但您不能删除,?page=
因为这是一个查询参数,而不是您所想的“url”的一部分。所以它看起来像http://127.0.0.1/public_html/organisation/home?page=Your-Profile
如果您使用的是 wordpress,那么管理员中有一个选项可以设置“漂亮的 url”,这将通过其他方式实现。
推荐阅读
- sql - 在访问查询中将组合框值作为比较运算符传递?
- reactjs - react-select 异步请求方法
- design-patterns - 设计模式工厂或单例或抽象工厂或构建器?
- c++ - 如何在 Fastor 或 Xtensor 中编写快速的 c++ 惰性评估代码?
- r - 运行 t 检验时如何修复错误
- android-studio - 如何修复 Android 4.0.1 编译器类路径
- c++ - 如何存储以 0 开头的数字的第一位?(例如 09080)
- python - 我正在将分类器模型应用于具有相应系列的熊猫系列并出现此错误,我该如何解决?请帮助
- flutter - DraggableScrollableSheet 在滚动前捕捉到顶部
- c++ - AC_CHECK_LIB 在 mingw64 中失败