将每个请求(指定除外)转发到同一个 php 文件

发布于 2024-09-24 05:29:24 字数 329 浏览 2 评论 0原文

我试图将每个请求(带参数)路由到文件 home.php,而不更改 URL,除了我们想要正常进行的几个请求,即

/user.php?a=new 应该转发到 /home.php?a=new但浏览器 url 仍应显示 /user.php?a=new

/profiles/user.php?a=delete 应指向 /home.php?a=delete 并且 url 应与输入的保持相同。

并且不转发此网址 /bounce/setting.php 仍应转到 /bounce/setting.php。基本上 /bounce 下的任何内容都应该照常工作。

提前致谢。

维沙尔

I am trying to route every request(with params) to file home.php without changing the URL other than few we would like to go as normal i.e.

/user.php?a=new should forward to /home.php?a=new but browser url still should show /user.php?a=new

/profiles/user.php?a=delete should point to /home.php?a=delete and url should stay same as entered.

and not forward for this url
/bounce/setting.php should still go to /bounce/setting.php. basically anything under /bounce should work as usual.

Thanks in advance.

Vishal

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

很酷不放纵 2024-10-01 05:29:24
RewriteCond %{REQUEST_URI} !bounce/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* /home.php [L,QSA]

...假设 user.php 等脚本并不真正存在。

RewriteCond %{REQUEST_URI} !bounce/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* /home.php [L,QSA]

... assuming the user.php etc. scripts don't really exist.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文