0

我的 .htaccess 文件包含以下代码。当我浏览以下链接时,url 会发生变化,但不会完全被替换,而是附加到上一页 ur 中,例如。如果我的 url 显示 home 然后我点击一个链接将我带到donordashboard.php 之后 url 将更改为 home/dashboard/donar 如果我点击另一个链接将我带到donor_profile.php url 将更改为 home/dashboard /个人资料编辑/捐助者。这样长度不断增加。请帮忙 。

RewriteEngine On

RewriteRule home home.php
RewriteRule add/blood_bank add_blood_bank.php
RewriteRule add/blood/donar add_as_a_blood_donar.php

RewriteRule dashboard/donor donordashboard.php
RewriteRule profileedit/donor donor_profile.php
RewriteRule add/last/donated/blood add_last_donated_blood.php
RewriteRule change/pwd/donor blood_change_pwd.php
RewriteRule logout common/logout.php

RewriteRule login_bd bdlogin.php
RewriteRule blood_donor_login blood_donor_login.php
4

2 回答 2

0

这里的这条线可能一直在重定向,对吧?

RewriteRule logout common/logout.php

你应该把绝对网址改为

RewriteRule /logout /common/logout.php

您可以尝试添加 [R=301,L]

RewriteRule /logout /common/logout.php [R=301,L]

--

并添加完整的绝对网址,因此您的代码将是:

RewriteEngine On

RewriteRule /home /home.php
RewriteRule /add/blood_bank /add_blood_bank.php
RewriteRule /add/blood/donar /add_as_a_blood_donar.php

RewriteRule /dashboard/donor /donordashboard.php
RewriteRule /profileedit/donor /donor_profile.php
RewriteRule /add/last/donated/blood /add_last_donated_blood.php
RewriteRule /change/pwd/donor /blood_change_pwd.php
RewriteRule /logout /common/logout.php

RewriteRule /login_bd /bdlogin.php
RewriteRule /blood_donor_login /blood_donor_login.php
于 2013-02-04T10:23:54.923 回答
0
Options +FollowSymLinks
RewriteEngine On
RewriteBase /facebook_login/

RewriteBase如果文件在根目录中,请尝试添加,只需添加 / 或文件夹路径

于 2013-02-04T11:37:35.627 回答