php - .htaccess url 重写后,某些url 重写的页面无法执行注销

标签 php css .htaccess url-rewriting

最近,我在做 .htaccess url 重写,将我所有的 php url 变成 html,在某些页面中,注销按钮无法正常工作。例如,在页面“quotedetails/Q9999.html”(重写自“quotedetails.php?quoteID=Q9999”)中,当我单击此页面中的注销按钮时,它不会起作用,但是当我使用旧的 php url 时这个页面,它再次工作,其他重写的页面,如 index.html (index.php)、search.html(search.php),都工作得很好。

我使用 firebug 进行调试,在我单击注销按钮后,它停留在同一页面中,而没有将我重定向到 index.html,但我看到“注销”参数已经通过,但不要让我注销并重定向到索引页面。我已经将所有相关文件路径更改为绝对路径,仍然没有运气......请帮助。

我还从 firebug 中注意到,该页面无法像我在其他页面中尝试的那样获得重定向“位置”,它们的响应 header 带有“位置:index.html”,但在那个无工作页面中,有在其响应 header 中没有名为“位置:index.html”的行。

这是我的 .htaccess 文件,no-workin-pages 与前四个 ReweiteRules 相关

Options +FollowSymlinks
RewriteEngine on

RewriteRule ^reps/all,all.html$ rep.php?repID=all&repName=all   
RewriteRule ^reps/([A-Z]+),([A-Za-z\sA-Za-z]+).html$ rep.php?repID=$1&repName=$2
RewriteRule ^reps/([A-Za-z]+),([A-Za-z\sA-Za-z]+),([0-9]+).html$ rep.php?repID=$1repName=$2&page=$3
RewriteRule ^quotedetails/(Q[0-9]+).html$ quotedetails.php?quoteID=$1

RewriteRule ^index.html$ index.php   
RewriteRule ^addquote.html$ addquote.php   
RewriteRule ^search.html$ search.php   
RewriteRule ^viewall.html$ viewall.php   
RewriteRule ^howto.html$ howto.php   

最佳答案

all the CSS will be lost, how to fix this issue?

对所有 CSS 文件和图像使用绝对路径

I click log out button, its not working

您至少必须进行初始调试。 没有人 这里知道,当您按下按钮时会发生什么。去图吧。

关于php - .htaccess url 重写后,某些url 重写的页面无法执行注销,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2996772/

相关文章:

css - Spring Boot + Thymeleaf css 不适用于模板

css - 为什么页脚没有粘在底部?

php - mysql 可以在查询中解码吗?

php - 在 PHPUnit 测试执行期间隐藏输出

php - WebSocket 与 PHP 的连接

css pos系统布局与flex

php - 对 SQL 表中的 2 列进行计数并分组

php - 使用 .htaccess 的 Apache 文档根目录

apache - 允许对 http 和 https 的跨源请求

.htaccess - 如何使用 .htaccess 重定向到包含 HTTP_HOST 的 URL?