1
這是我的.htaccess文件的.htaccess重複我的鏈接
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)$ index.php?id=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)$ index.php?id=$1&iff=$2 [L]
這是我的PHP文件
的index.php
<?php
$ll1=$_GET["id"];
$ll12=$_GET["iff"];
?>
<a href="Make/Mak">aaa</a><a href="Make"> bbb</a>
<?php
if($ll1=="Make" && $ll12=="Mak"){include 'shop/index.php';}
elseif($ll1=="Make"){include 'shop/productpreview.php';}
?>
這個問題是,當我點擊第一個鏈接(aaa)它與網址(https://localhost/Make/Mak)打開很好
但是當我再次單擊它時,它顯示對象不是fou nd與網址(https://localhost/Make/Make/Mak)。
請有人能幫助我爲什麼它是複製第一個參數?
我有三個參數試了一下,它複製了第一和第二參數
感謝您的時間在期待
您的href當你在'的https :// localhost/Make/Mak'瀏覽器認爲你在'root/Make /'目錄下,因此該頁面中的鏈接獲取第一個'Make /'作爲前綴,因爲普通URL基於它們所在的當前目錄。爲了解決這個問題,你可以使用這樣的鏈接,從根目錄不是當前目錄的路徑:'aaa' – Night2
是的非常感謝。但我從不知道它會追捕我的問題中刪除一些信息。 這是真正的URL(https:// localhost/bell/Make/Mak)而不是(https:// localhost/Make/Mak)。我在我的htdocs中有很多網站,其中一個是鈴。所以當我把aaa它需要我退後一步,我不想要。我的.htaccess位於我的鈴聲文件夾中。再次感謝您的時間 – Odin
Night2非常感謝。正如你所說,我將它改爲aaa,它運行良好,非常完美。我非常感謝 – Odin